[問題] 在Java Applet中顯示日文

看板java作者 (RYAN)時間15年前 (2010/05/03 17:35), 編輯推噓1(101)
留言2則, 2人參與, 最新討論串1/2 (看更多)
想請問一下,如何在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

05/03 17:51, , 1F
properties 應該要用 \u 的方法儲存吧?
05/03 17:51, 1F

05/03 17:57, , 2F
檢查一下瀏覧器的頁面語言設定是否為UTF-8...
05/03 17:57, 2F
文章代碼(AID): #1BtfZRsv (java)
文章代碼(AID): #1BtfZRsv (java)