TransformerFactory tFactory =TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
Properties properties = transformer.getOutputProperties();
properties.setProperty(OutputKeys.ENCODING,"GB2312");
transformer.setOutputProperties(properties);
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(ssr);
transformer.transform(source, result);
Transformer transformer = tFactory.newTransformer();
Properties properties = transformer.getOutputProperties();
properties.setProperty(OutputKeys.ENCODING,"GB2312");
transformer.setOutputProperties(properties);
DOMSource source = new DOMSource(doc);
StreamResult result = new StreamResult(ssr);
transformer.transform(source, result);
解决方案 »
- 听说hibernate有四种操作数据库的方式,哪位大侠来解释一下啊。
- 求JSReport资料,
- Spring中BeanFactory与ApplicationContext的差别?
- 问一个关于ssl认证的问题,解决给100
- jsp自定义标签能不能得到页面文本框的值啊?
- 求高手帮助
- 网页无法执行
- 100分求解:linux9下weblogic8.1.2console左侧树形菜单无法显示!!
- 急,JB里面如何配置ejb的编程环境?
- 连接oracle的问题
- 请问jboss下如何在根路径显示出http://localhost:8080/image.jpg?
- 用jsp + xml做了一个类似csdn的论坛,跟贴者有分~~~~
ssr是什么? 不过整个xml没什么问题, 现在的问题只想问说
怎么把读入的String转成UTF-8的?
properties.setProperty(OutputKeys.ENCODING,"GB2312");
中的GB2312改成utf-8不就可以了。
由于笔误ssr,你大可不必管它的,呵呵
properties.setProperty? setProperty(String key,
String value)
这么设有用吗?
想问一下, 有没有简单的改变String编码的方法.