日文正常显示.
String s = "";
int lintline = 0;
BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(filename)));
while ((s = in.readLine()) != null)
{
cstrout[lintline] = s;
lintline++;
}
如上,javabean里把一个文件的内容读入cstrout字符数组,
然后在JSP中显示。
现在半角字符显示正常,全角字符为乱码,怎么转换?
注:是日文系统,JSP中的encode为SHIFT_JIS,
<%@ page contentType="text/html; charset=SHIFT_JIS" %>
其他日文字都可正常显示。
String aaa = new String(s.getBytes("8859_1"),"SHIFT_JIS");
用上面的转换方式,无效。在jsp中显示aaa也是乱码,
各位大虾请赐教