Subject Re: Language ID and charset/collation correspondence
Author peter_jacobi.rm
Hi Pavel, All,

--- In firebird-support@yahoogroups.com, "pavel_menshchikov" wrote:
> Can anyone reference me to the information about the correspondence
> between the language ID (used in windows lacale) or the full language
> name ("canadian french" for example) and the most appropriate
> charset/collation for the language in FB/IB? (The more complete list
> the better)

A systematic set of collations so far exists only for
the ISO-8859-1 character set.

There you can use:

1. Retrieve user or system locale id into LCID lcid.

2. GetLocaleInfo (lcid, LOCALE_IDEFAULTANSICODEPAGE, ...)
If you get 1252, it's fine to proceed

3. GetLocaleInfo (lcid, LOCALE_SISO639LANGNAME, ...)
and GetLocaleInfo (lcid, LOCALE_SISO3166CTRYNAME, ...)

4. Look (case insensitive) for <language>_<country> in
rdb$collations

5. If not found, as a fallback look (case insensitive)
for <language>_% in rdb$collations

Regards,
Peter Jacobi