I18N Section Index
What's a BOM?
BOM stands for Byte Order Mark and could be the initial bytes of a UTF-encoded stream, typically used to indicate endianess of the stream. Prior to Java 6, if present, your program needed to handl...more
How can I have an XML-based resource bundle?
Until JDK 6.0, you can't. Only ListResourceBundles and PropertyResourceBundles are supported. With 6.0, you can create a custom ResourceBundle.Control implementation which allows you to support AN...more
How can I store international / Unicode characters into a cookie?
Example:
I would like to put this String: "até" The problem is when I get the cookie value I receive "at".
----------------------
One way is that before storing the cookie URLEncode it.
...more
In the article Internationalizing Servlets, the author states the current PropertyResourceBundle class is less efficient in a multithreaded world (like in J2EE/servlets) because it's based on Hashtable, that has synchronized calls.
In the article Internationalizing Servlets, the author states the current PropertyResourceBundle class is less efficient in a multithreaded world (like in J2EE/servlets) because it's based on Hasht...more
What are the considerations for searching text in Java? Are there any tools available?
Efficient text searching in Java: Finding the right string in any language by Laura Werner provides a good overview, along with code, of I18N and Unicode text search issues. As pointed out in the...more
How can I obtain the languages spoken in a country? For example, Locale has a private method getLanguagesForCountry, but I can't use it since it's private. Is there another way to obtain the languages spoken in a given country?
This is an interesting question because the answers, none of which may be satisfactory, depend on how the information is to be used.
"I want to present countries and the languages spoken in them ...more
How can I set a customized currency symbol to be applied to a number?
How can I set a customized currency symbol to be applied to a number?
DecimalFormat df = new DecimalFormat();
DecimalFormatSymbols dfs = new DecimalFormatSymbols();
dfs.setCurrencySymbol("Rs");
df...more
How is non-default character encoding specified for an XML document?
For non-default encoding, the XML text declaration should contain an encoding declaration as in the following examples:
<?xml encoding='UTF-8'?>
<?xml encoding='EUC-JP'?>
Acceptable...more
How can I display the current time as GMT?
Create a custom TimeZone and use it for DateFormat.setTimeZone(). This is discussed briefly in the API documentation and shown in the following code.
import java.text.*;
import java.util.*;
pub...more
How can I internationalize XSLT auto-numbering?
The xsl:number element provides for auto-numbering. The format attribute and, potentially, the letter-value attribute can be used to internationalize numbering. Any alphanumeric character that h...more
How do I convert HTML form data from ASCII/HTML representation to a true Java Unicode string?
How do I convert HTML form data from ASCII/HTML representation to a true Java Unicode string? I have a JSP that stores what should be a Unicode stream into a NCLOB. The insert happens fine, however...more
What is the default encoding for HTML and XML?
Through HTML 3.2, the eight bit standard was ISO 8859-1. As of HTML 4.0, the default document character set is Unicode. For XML, the absolute default is UTF-8. However, a Byte Order Mark ( BOM ...more
What is a char?
While the char type is basic to the Java language, many programmers stumble over Unicode escapes, values and conversions. The first definition should be familiar:
A 16 bit primitive data type w...more
How many standard time zones exist?
Actually there are 25. The unexpected "extra" one comes about because there is a time zone for UTC+12 hours and one for UTC-12 hours. The International Date Line cuts through the middle of these...more
What is TMX?
TMX stands for Translation Memory eXchange. From the definition at TMX Format - Specifications: "The purpose of the TMX format is to provide a standard method to describe translation memory data ...more