final static public ResourceBundle TEXTS = PropertyResourceBundle.getBundle("locale.Texts",Locale.SIMPLIFIED_CHINESE);public static String local(String key)
{
try {
String value = MainFrame.TEXTS.getString(key);
System.out.println(getStr(value,"GB2312"));
System.out.println(getStr(value,"GBK"));
System.out.println(getStr(value,"ISO-8859-1"));
System.out.println(getStr(value,"gb2312"));
System.out.println(getStr(value,"UTF-8"));
return value;
} catch (Exception exc)
{
exc.printStackTrace();
}
return key;
}
public static String getStr(String str,String encode)
{
try
{
String temp_p=str;
byte[] temp_t=temp_p.getBytes(encode);
String temp=new String(temp_t);
return temp;
}
catch(Exception e){ }
return null;
} local.Texts_zh_CN.properties
内容部分如下
FRAME_TITLE=短信
#####################
#
#Texts Menu
#
#####################MENU_SYSTEM=系统 System但是 我用local("FRAME_TITLE")出来的中文无论如何都是乱码
但是如果是英文可以正常显示求那位大虾 出手相助
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货