What the heck is an LCID?

by Michael S. Kaplan, published on 2004/12/09 12:07 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2004/12/09/279020.aspx


I get this question all of the time -- of course usually the language is stronger.

An LCID is a locale identifier. Its a number that gets slapped onto each locale that Windows supports. That number represents a unique collection of data associated with a language, region, script, and sort. Easy, right?

Well, not so much. Because they are arbitrary, and they are not based on any kind of standard. they start off alphabetical but no room was left in the middle for additions. So as new LCIDs were added, they were stuck at the end.

Plus they are language-based -- all of the other data is added in terms of the language. Thus you can have 0x00c for the French language and 0x010 for the Italian language. But when you want the "French - Switzerland" LCID you get 0x100c and when you want "Italian - Switzerland" you have an LCID of 0x0810. So there is consistent way to pull out all of the Switzerlands by looking at the numbers....

There are lots of other things that stink about LCIDs, I'll cover more another day. But they are far from a perfect answer; the names used for cultures in the .NET Framework is a much better direction.


no comments

Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

go to newer or older post, or back to index or month or day