Obtain Locale Langage... more precisely LCID
What is good way to obtain the locale settings of the system ? I've seen that test_locale.cpp is stored in regress... so if it is deprecated, what is the up to date method ? For example if I want to obtain the LCID (codes in 2 parts giving locale language) what can I use ? I don't want to treat numbers, money or so what.. but only get langage !!! Can I do it with boost ?
Germain BARRET:
For example if I want to obtain the LCID (codes in 2 parts giving locale language) what can I use ?
LCID is a Windows-specific concept, right? If that's the case, you could use the Win32 API directly (GetThreadLocale(), GetUserDefaultLCID(), etc.)
I don't want to treat numbers, money or so what.. but only get langage !!! Can I do it with boost ?
To my knowledge, there is nothing for this in Boost. If you're looking for something portable, you may look at the ICU library. IMHO, it's interface style leaves much to be desired, but the array of functionality is impressive and useful. HTH, Éric Malenfant --------------------------------------------- Experience is something you never have until just after you need it. - Alfred E. Neuman
Hi Germain,
You might want to study the standard C++ "Facets". I did spot an
article by an eminent lady software professional about facets
somewhere on the Internet around a year back - it was probably a book.
You'll find details about facets in "The C++ Programming Language,
Special 3rd Edition". ALSO, you can also find the complete
"Facets-related" content of the book ("The C++ Programming Language,
Special 3rd Edition") on the website of Bjarne Stroustrup - the C++
inventor. However, you might want to check out the portability issues
& support of various compilers.
--
Asif
On 6/18/08, Germain BARRET
What is good way to obtain the locale settings of the system ? I've seen that test_locale.cpp is stored in regress... so if it is deprecated, what is the up to date method ?
For example if I want to obtain the LCID (codes in 2 parts giving locale language) what can I use ?
I don't want to treat numbers, money or so what.. but only get langage !!! Can I do it with boost ?
participants (3)
-
Asif Lodhi
-
Eric MALENFANT
-
Germain BARRET