Alexander Voropay writes:
> How to get a list of supported encodings INSIDE my application ?
An ugly way is to call "iconv -l", and parse the resulting
output. Note that this output is human-readable, and it's in a system
dependent format.
But what do you want to do with such a list? If you only want to test
whether a given encoding is supported, you can use
iconv_open("UTF-8",encoding);
If you want a user to choose an encoding among many, I like the way
it's done in Netscape: the menu entries list both the language and the
unambiguous encoding name:
Western (ISO-8859-1)
Cyrillic (ISO-8859-5)
Traditional Chinese (Big5)
etc.
This has the benefit that:
- Users are not bothered to type encoding names.
- Users who are not aware what encodings are don't have to learn
cryptic names; they can use the plain text description of the
encoding ("Western", "Cyrillic", ...)
- Expert users can see the standard encoding name. (For those who
know the distinction between ISO-8859-5 and KOI8-R.)
Bruno
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/lists/