tags:

views:

210

answers:

1

I'm reading an XML file inside a product to collects its inventory information i.e. various components it contains and when they are installed. I know from the product properties file that locale of the product is "ccjk". It stands for simplified Chinese for Japanese and Korean I guess. I want to set the locale of the shell before I run this Java program so that it pics the locale from the shell environment. Usually locale is set in the following way

export LOCALE="ch_TW.UTF_8" This locale is Chinese for Taiwanese and the UTF_8 stands for character encoding. I would like to know the string something like above ch_TW.UTF_8 which I need to put my locale to ccjk.

quicke help is highly appreciated

A: 

According to the Wikipedia Article there are several possible character sets. The language and country code don't really matter here (except for date and number formatting), but from chinese mappings you want a prefix with 'zh' not 'ch' AFAICT. Here's a list on my system of supported character sets (on ubuntu it's in /usr/share/i18n/SUPPORTED:

zh_CN.GB18030 GB18030
zh_CN.GBK GBK
zh_CN.UTF-8 UTF-8
zh_CN GB2312
zh_HK.UTF-8 UTF-8
zh_HK BIG5-HKSCS
zh_SG.UTF-8 UTF-8
zh_SG.GBK GBK
zh_SG GB2312
zh_TW.EUC-TW EUC-TW
zh_TW.UTF-8 UTF-8
zh_TW BIG5

It might very well be that the file is UTF-8 but you didn't get it to work because you got the language codes wrong.

Note that you can also pass character sets to an InputStreamReader in java, so your VM doesn't necessarily have to be working in the same charset as your data.

wds
yeah.. You are true. VM doesn't necessarily have to be working in the same charset as my data. I guess problem is not with the charset but with the language.
ram