Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The java.util.Locale class represents a locale. There are three main components of a Locale object: language, country, and variant. The language is obviously the most important part; however, sometimes the language itself is not sufficient to differentiate a locale. For example, the English language is spoken in countries such as the US and England. However, the English language spoken in the US is not exactly the same as the one used in the UK. Therefore, it is necessary to specify the country of the language. As another example, the Chinese language used in China is not exactly the same as the one used in Taiwan.
The variant argument is a vendor- or browser-specific code. For example, you use WIN for Windows, MAC for Macintosh, and POSIX for POSIX. Where there are two variants, separate them with an underscore, and put the most important one first. For example, a Traditional Spanish collation might construct a locale with parameters for language, country, and variant as es, ES, Traditional_WIN, respectively.