I18N Section Index | Page 5
How can one store an Image in a ListResourceBundle in order to provide different images for different locales?
One method is to save your localized images in a .jar, as, say, image-fr.gif for french and image.gif as default. Then you can reference the image file name from ResourceBundles for each locale. F...more
How can I internationalize the spellout of numbers, like two for 2 in English, dos for 2 in Spanish?
First, to get a feel for the difficulty of the problem ( and probably more than you would ever want to know, ) see A Rule-Based Approach to Number Spellout. Then be happy that you can freely use...more
Here's the best document for a definitive answer, including the difference between character set and charset: RFC2278.more
For Netscape see Welcome to Netscape International!. For Microsoft see International Home Pages.more
Obviously the standard JDK documentation at Internationalization has links and discussion, but a good paper on the topic from two of the i18n developers is The Java International API: Beyond JDK 1.1.more
Are there standard classes that will perform western to Japanese or other date conversions? I'm especially interested in Japanese eras.
How to write a servlet which can transfer data written in ISO8859-1 into GB2312 or another kind of character encoding?
You can use this method to transfer your data from one standard encoding to another one. I have written it out and tested it under JSDK 2.0, and it runs well. The following is the java code I have...more
For each national language supported by Unicode, what is the maximum number of bytes used to represent any character of that language when using UTF-8?
I don't know of an available table like that offhand, but you can tell from any character what the UTF-8 result will be. Basically, for UCS-2, or 16 bit Unicode, the character range 0 - hex 7F ( ...more
You need to be sure to set the character set when you set the content. The following example demonstrates. The message content is the numbers from 1-10. import java.util.Properties; import javax...more
You can specify the encoding at compile time with the -encoding option to the javac compiler.
How can one use the ResourceBundle class in an applet to retrieve locale specific information over the Internet?
Resource bundle files are located relative to the codebase of the applet. For instance, if you place the applet files into a JAR file, and ask for a bundle with ResourceBundle.getBundle("Trai...more
The short answer is to use Numberformat.getCurrencyInstance(), then use the format() and parse() methods. I have included a non-production quality code sample that accepts input in one's local cu...more
A Locale object represents and provides various information about "a specific geographical, political, or cultural region," as seen at Locale. However, in and of itself, that's all a Lo...more
How can I read GET or POST parameters that were encoded in an international character set? Also, when a user fills in an HTML Form using a custom Input Method Editor for, say, Japanese, how can my servlet/JSP know which encoding was used?
The HttpServletRequest object from 2.0 on provides a method for retrieving the client's character encoding. The follwing sample gets the parameter mytext and converts it to a java Un...more
I understood that Java always uses Big Endian. Why does the code at How can I store and retrieve Unicode or Double Byte data in a file using the java.io libraries? produce Little Endian output?
Actually, Java's guaranteed usage of Big Endian only applies to what I will loosely call "numbers." String or byte encodings for characters are a different matter altogether. The Littl...more