Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2005

Tip: Looking for answers? Try searching our database.

Unicode String Literals

Thread view: 
didster@gmail.com - 21 Nov 2005 11:01 GMT
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
Thomas Kellerer - 21 Nov 2005 11:12 GMT
> Hi all,
>
[quoted text clipped - 19 lines]
>
> 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
didster@gmail.com - 21 Nov 2005 11:32 GMT
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
Roedy Green - 21 Nov 2005 11:33 GMT
>When running, the string is mangled and the é is replaced by A@.  I
>know you can do this:

You must tell Javac which 8-bit encoding you used. See
http://mindprod.com/jgloss/javacexe.html
and
http://mindprod.com/jgloss/enoding.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

Roedy Green - 21 Nov 2005 11:43 GMT
On Mon, 21 Nov 2005 11:33:23 GMT, Roedy Green
<my_email_is_posted_on_my_website@munged.invalid> wrote, quoted or
indirectly quoted someone who said :

>You must tell Javac which 8-bit encoding you used. See
>http://mindprod.com/jgloss/javacexe.html
>and
>http://mindprod.com/jgloss/enoding.html

oops >http://mindprod.com/jgloss/encoding.html
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.