Results 1 to 2 of 2
  1. #1
    javastuden's Avatar
    javastuden is offline Senior Member
    Join Date
    Nov 2009
    Posts
    162
    Rep Power
    6

    Default read japanese word from resourse bundle

    hi
    i had a property file in that there is a japanes word i want to read that by resourcebundle key value
    how can i do that
    public class Testencoding {
    public static void main(String[] args) throws UnsupportedEncodingException, IOException {
    Locale currentLocale = Locale.JAPANESE;
    ResourceBundle myResources =
    ResourceBundle.getBundle( "xxxx",currentLocale );
    JButton okButton = new JButton( myResources.getString( "OkButtonLabel" ));
    JLabel hoursLabel = new JLabel( myResources.getString( "hours" ));
    System.out.println( okButton.getText() ); // e.g. Eh?
    System.out.println( hoursLabel.getText() ); // e.g. HH

    but its shows some symbols its not as the value stored in the eclipse character encoding property page
    ˜‡ž工*ƒƒ‹ƒ‚‚ƒ‚

    please help me

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,784
    Blog Entries
    7
    Rep Power
    21

    Default

    If your ResourceBundle is stored in a file it is a PropertiesResourceBundle which basically is the file representation of a Properties object. A Properties object is quite an old class; read what it has to say about its character encoding:

    Quote Originally Posted by API documentation
    The load(Reader) / store(Writer, String) methods load and store properties from and to a character based stream in a simple line-oriented format specified below. The load(InputStream) / store(OutputStream, String) methods work the same way as the load(Reader)/store(Writer, String) pair, except the input/output stream is encoded in ISO 8859-1 character encoding. Characters that cannot be directly represented in this encoding can be written using Unicode escapes ; only a single 'u' character is allowed in an escape sequence. The native2ascii tool can be used to convert property files to and from other character encodings.
    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. How to read the word character in image file.
    By sureshsoftengg in forum Java Software
    Replies: 1
    Last Post: 09-21-2010, 04:37 PM
  2. read the word character in image file
    By sureshsoftengg in forum Advanced Java
    Replies: 2
    Last Post: 09-21-2010, 04:36 PM
  3. Read Bookmarks from a word document using apache POI
    By anuskesh in forum Advanced Java
    Replies: 0
    Last Post: 07-28-2010, 05:36 AM
  4. tomcat resource bundle tab not appearing??
    By freddieMaize in forum NetBeans
    Replies: 2
    Last Post: 05-25-2008, 10:15 AM
  5. Archiving old posts into a bundle,FAQ or tutorial
    By cruxblack in forum Suggestions & Feedback
    Replies: 1
    Last Post: 11-14-2007, 01:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •