Unicode String Literals

D

didster

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 A@. 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
 
T

Thomas Kellerer

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 A@. 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

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
 
D

didster

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top