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
What is the difference between character set and character encoding?
Here's the best document for a definitive answer, including the difference between character set and charset: RFC2278.more
Where can I find discussion/information on new I18N capabilities since JDK 1.1?
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
Where can I find information about the i18n capabilities of the major browsers?
For Netscape see Welcome to Netscape International!.
For Microsoft see International Home Pages.more
Are there standard classes that will perform western to Japanese or other date conversions? I'm especially interested in Japanese eras.
There are not any standard converters supplied with the JDK,
but there are applets and useful information at Japanese Era to/from Christian Year Converters. Javascript versions are also supplied,...more
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
Where can I find a detailed code example of sending non-ASCII messages (Japanese in my case)?
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
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
How do I compile a ListResourceBundle that is not encoded with straight ASCII characters?
You can specify the encoding at compile time with the -encoding option to the javac compiler.
How do I display and parse currency values?
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
What is a locale and why is it useful?
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