Discussion:
setlocale accepts more language strings
(too old to reply)
Steve Jones
2010-05-28 18:58:08 UTC
Permalink
I was looking into the use of strftime() to format dates in other languages,
which seems to work if you first use setlocale() with one of the language
strings listed here

http://msdn.microsoft.com/en-us/library/39cwe7zf%28v=VS.80%29.aspx

However, it also seems to accept many of the strings in the Locale column
listed here

http://msdn.microsoft.com/en-us/goglobal/bb895996.aspx

For example, "Welsh" does not appear in the first list, but is accepted by
setlocale, and strftime returns Friday as "Dydd Gwener" which is correct.

Is the first list out of date with regards to setlocal() ?

Is there a way of finding out all of the locales which really are supported
by setlocale/strftime on the PC (presumably depends on what language packs
are installed) ?
Igor Tandetnik
2010-05-28 19:24:35 UTC
Permalink
Post by Steve Jones
Is there a way of finding out all of the locales which really are
supported by setlocale/strftime on the PC (presumably depends on what
language packs are installed) ?
If you want to know the exact details, check setlocal.c and getqloc.c in CRT sources (<VS installation folder>\vc\crt\src). It's an elaborate wrapper around EnumSystemLocales.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925
Loading...