作者jawwoeima (RYAN)
看板java
标题[问题] 在Java Applet中显示日文
时间Mon May 3 17:35:19 2010
想请问一下,如何在Applet中
显示日文,我的messages_ja.properties是用UTF-8存
内容为
# Message.properties
ezpage.mainmenu=メインメニュー
以下是我的code
private Locale locales = null;
private ResourceBundle resource = null;
try {
locales = new Locale("ja", "");
} catch (Exception e) {
System.out.println("[ERROR] : "+e.toString());
locales = Locale.getDefault();
}
ResourceBundle resource = ResourceBundle.getBundle("messages", locales);
// read string from properties file
String main_menu_str = resource.getString("ezpage.mainmenu");
但是main_menu_str 显示出来都是乱码
想请问是否我作法做错了,该如何在Applet中显示出日文
网路查了很久,都没试出来,谢谢各位的回答
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.124.42.161
1F:推 PsMonkey:properties 应该要用 \u 的方法储存吧? 05/03 17:51
2F:→ pico2k:检查一下浏覧器的页面语言设定是否为UTF-8... 05/03 17:57