How to find if a locale is supported by given encoding?

J

jaibarde

Hi,

I have a need to show list of locales into a field on a wizard ( a
Java based application). But these locales should be such that they
are supported by the current character set (encoding) selected by the
user on his machine. Is there any Java utility function or set of
function or package, using which, I can somehow figure out my current
character set / encoding would support the given locale?



Thanks,

~jaideep
 
R

Roedy Green

I have a need to show list of locales into a field on a wizard ( a
Java based application). But these locales should be such that they
are supported by the current character set (encoding) selected by the
user on his machine. Is there any Java utility function or set of
function or package, using which, I can somehow figure out my current
character set / encoding would support the given locale?

see http://mindprod.com/jgloss/encoding.html

to get a list of the supported encodings. The set of encodings
supporting will be sufficient for many locales, not just the current
one.

I don't think there is any official mapping of encodings to locales or
vice versa. You could cook up a list for each locale of likely
encodings. See http://mindprod.com/jgloss/encoding.html
for the raw data.
 
A

Arne Vajhøj

jaibarde said:
I have a need to show list of locales into a field on a wizard ( a
Java based application). But these locales should be such that they
are supported by the current character set (encoding) selected by the
user on his machine. Is there any Java utility function or set of
function or package, using which, I can somehow figure out my current
character set / encoding would support the given locale?

I think it would be better to go Locale->Encoding than
Encoding->Locale.

There are no official mapping between Local and Encoding.

Google find pages like:

http://www.bitrixsoft.com/help/inde.../help/en/developer/general/lang/code.php.html

I think best advice is to strict UTF-8.

With fallback being to manually create a mapping between Locale
and Encoding.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top