中文问题。给你一个函数,调用一下就可以了,
public static String UnicodeToChinese(String s){
try{
if(s==null||s.equals("")) return "";
String newstring=null;
newstring=new String(s.getBytes("ISO8859_1"),"gb2312");
return newstring;
}
catch(UnsupportedEncodingException e)
{
return s;
}
}public static String ChineseToUnicode(String s){
try{
if(s==null||s.equals("")) return "";
String newstring=null;
newstring=new String(s.getBytes("gb2312"),"ISO8859_1");
return newstring;
}
catch(UnsupportedEncodingException e)
{
return s;
}
}
public static String UnicodeToChinese(String s){
try{
if(s==null||s.equals("")) return "";
String newstring=null;
newstring=new String(s.getBytes("ISO8859_1"),"gb2312");
return newstring;
}
catch(UnsupportedEncodingException e)
{
return s;
}
}public static String ChineseToUnicode(String s){
try{
if(s==null||s.equals("")) return "";
String newstring=null;
newstring=new String(s.getBytes("gb2312"),"ISO8859_1");
return newstring;
}
catch(UnsupportedEncodingException e)
{
return s;
}
}
解决方案 »
- CardLayout在JPanel中应用异常
- 数据源获取连接慢?
- Java实现各种排序!(二)
- JAVA中System.out与System.err的区别是什么
- 什么原因导致我的Tomcat不稳定!!急啊!!!
- 请教:使用批处理文件启动java应用程序后如何自动关闭命令窗口
- 杭电的1005题 Number Sequence 各位帮忙看看
- 大家做oa的时候,在邮件部分,一定要用javamail吗?
- 那有实现画流程图的JAVA 源码?
- 用JAVA编写的APPLET为何在IE中不能显示?需要那些设置?
- AccessControlException的错误,欢迎光临.
- 如何去掉IE里面对刷新post结果页面的提示框?
你用的是不是jdk1.4.0的Windows Look&Feel啊?这是一个Bug,1.4.1中已经修正了。
graphics2d对象,在这个graphics2d上drawString个中文的字符串,让后在绘出整个的bufferedImage在这个component上,怎么办,高人,,救我...