Unicode String Literals

Discussion in 'Java' started by didster, Nov 21, 2005.

  1. didster

    didster Guest

    Hi all,

    I am trying to convert an app we have to french. We have all the
    strings translated, and I am trying to get things working.

    The problem we are having is we have the strings in "real" format, such
    as :

    "Entrée d'agenda"

    This, is put in code as:

    public static final String Run_Diary = "Entrée d'agenda";

    When running, the string is mangled and the é is replaced by [email protected] I
    know you can do this:

    public static final String Run_Diary = "Entr\u00E9e d'agenda";

    And that works, but is there a way to specify the literal string
    without escaping it?

    Thanks
     
    didster, Nov 21, 2005
    #1
    1. Advertisements

  2. There is a tool as part of the JDK which does this for you:

    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/native2ascii.html

    Thomas
     
    Thomas Kellerer, Nov 21, 2005
    #2
    1. Advertisements

  3. didster

    didster Guest

    Thanks very much!

    I have been messing around with the encoding options in netbeans, which
    are suppose to do it (so some people claim) and can't get that to work,
    so I will try this
     
    didster, Nov 21, 2005
    #3
  4. didster

    Roedy Green Guest

    Roedy Green, Nov 21, 2005
    #4
  5. didster

    Roedy Green Guest

    Roedy Green, Nov 21, 2005
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.