txt文件中有繁体字.
在jsp中显示的是?号.怎么将繁体字显示出来,请大家帮忙看下
in = new BufferedReader(new FileReader(strAbsPath + "//ttt.txt"));
String f="~~~";
while((str = in.readLine()) != null){
String tos = str;
应该怎么转?
txt文件中有繁体字.
在jsp中显示的是?号.怎么将繁体字显示出来,请大家帮忙看下
in = new BufferedReader(new FileReader(strAbsPath + "//ttt.txt"));
String f="~~~";
while((str = in.readLine()) != null){
String tos = str;
应该怎么转?
将txt文件另存为.在另存对话框中,选择编码项为UTF-8.
再将读取到的内容字符串进行编码.转换为UTF-8的格式.
[code="java"]
byte[] bytes = str.getBytes("UTF-8");
String result = new String(bytes, "UTF-8");
[/code]