This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes String and internationalization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "String and internationalization" Watch "String and internationalization" New topic
Author

String and internationalization

Cherry Mathew
Ranch Hand

Joined: Dec 26, 2000
Posts: 159

Hi
Does java.lang.String support internationalization fully. Which all functions doesnt support?
what are the issues i need to take care of when using string?
is it a good idea to use a wrapper for String class for internationalization.
Cherry
Wilfried LAURENT
Ranch Hand

Joined: Jul 13, 2001
Posts: 269
What do you mean by "Does String support FULLY internationalization"?
Internationalization is supported through the use of ResourceBundles (see the tutorial on the site of Sun, or the javadoc). Depending on how your Locale is set, you will get Ja, Yes, Oui, Da ... on a call.
W.
[This message has been edited by Wilfried LAURENT (edited October 16, 2001).]
[This message has been edited by Wilfried LAURENT (edited October 16, 2001).]
Cherry Mathew
Ranch Hand

Joined: Dec 26, 2000
Posts: 159
By full support i asked abt the frunctions of String class
Thanx for the reply
Cherry
Wilfried LAURENT
Ranch Hand

Joined: Jul 13, 2001
Posts: 269
There is no method in the String class supporting internationalization, if you give to "internationalization" the standard meaning. Can you give an example or develop your idea?
W.
Cherry Mathew
Ranch Hand

Joined: Dec 26, 2000
Posts: 159
What if im passing a japaneese string to the compareTo function 2) using String tokenizer
etc
Thanx
regards
Cherry
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
The following ideas come from the following book:
Java Internationalization (O'Reilly March 2001) by Andrew Deitsch & David Czarnecky
You should not use the compareTo and equals method of the String class to compare "international" strings. Instead you should use the abstract class java.text.Collator.
First get an instance of the collator (here an instance of a collator for a french locale)

Then, use either collator.compare() or collator.equals() to compare two strings. Both methods take the two strings arguments and return an integer...
HIH

------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: String and internationalization
 
Similar Threads
assumptions
Does form:options support internationalization in 2.5.6
How Jsp work on different country languages
String.compareTo()
jasper , internationalization