Microsoft DirectX 9.0

Working with LCIDs

The LCID, or "locale identifer," is a 32-bit data type into which are packed several different values that help to identify a particular geographical region. One of these internal values is the "primary language ID" which identifies the basic language of the region or locale, such as English, Spanish, or Russian.

MSWebDVD requires a complete valid LCID as an input parameter for two methods: SelectDefaultAudioLanguage and SelectDefaultSubpictureLanguage. This can be any valid LCID recognized by Windows®, and even some that are not recognized by Windows. (It is not necessary that the host system actually support the locale with fonts, keyboard mappings, and so on.) The following table lists some common LCIDs as well as well as some less common ones that are valid for MSWebDVD even through Windows does not recognize them by default. This is not a complete list of all possible LCIDs.

Some Valid LCIDs

Afrikaans 0x0436 Albanian 0x041c Arabic (Algeria) 0x1401
Arabic (Bahrain) 0x3c01 Arabic (Egypt) 0x0c01 Arabic (Iraq) 0x0801
Arabic (Jordan) 0x2c01 Arabic (Kuwait) 0x3401 Arabic (Lebanon) 0x3001
Arabic (Libya) 0x1001 Arabic (Morocco) 0x1801 Arabic (Oman) 0x2001
Arabic (Qatar) 0x4001 Arabic (Saudi Arabia) 0x0401 Arabic (Syria) 0x2801
Arabic (Tunisia) 0x1c01 Arabic (U.A.E.) 0x3801 Arabic (Yemen) 0x2401
Basque 0x042d Belarusian 0x0423 Bulgarian 0x0402
Catalan 0x0403 Chinese (Hong Kong SAR) 0x0c04 Chinese (PRC) 0x0804
Chinese (Singapore) 0x1004 Chinese (Taiwan) 0x0404 Croatian 0x041a
Czech 0x0405 Danish 0x0406 Dutch (Belgian) 0x0813
Dutch (Standard) 0x0413 English (Australian) 0x0c09 English (Belize) 0x2809
English (Canadian) 0x1009 English (Caribbean) 0x2409 English (Ireland) 0x1809
English (Jamaica) 0x2009 English (New Zealand) 0x1409 English (South Africa) 0x1c09
English (Trinidad) 0x2c09 English (United Kingdom) 0x0809 English (United States) 0x0409
Estonian 0x0425 Faeroese 0x0438 Farsi 0x0429
Finnish 0x040b French (Belgian) 0x080c French (Canadian) 0x0c0c
French (Luxembourg) 0x140c French (Standard) 0x040c French (Swiss) 0x100c
German (Austrian) 0x0c07 German (Liechtenstein) 0x1407 German (Luxembourg) 0x1007
German (Standard) 0x0407 German (Swiss) 0x0807 Greek 0x0408
Hebrew 0x040d Hungarian 0x040e Icelandic 0x040f
Indonesian 0x0421 Italian (Standard) 0x0410 Italian (Swiss) 0x0810
Japanese 0x0411 Korean 0x0412 Korean (Johab) 0x0812
Latvian 0x0426 Lithuanian 0x0427 Malay (Malaysian) 0x043e
Malay (Brunei) 0x083e Norwegian (Bokmal) 0x0414 Norwegian (Nynorsk) 0x0814
Polish 0x0415 Portuguese (Brazil) 0x0416 Portuguese (Portugal) 0x0816
Romanian 0x0418 Russian 0x0419 Serbian (Cyrillic) 0x0c1a
Serbian (Latin) 0x081a Slovak 0x041b Slovenian 0x0424
Spanish (Argentina) 0x2c0a Spanish (Bolivia) 0x400a Spanish (Chile) 0x340a
Spanish (Colombia) 0x240a Spanish (Costa Rica) 0x140a Spanish (Dominican Republic) 0x1c0a
Spanish (Ecuador) 0x300a Spanish (El Salvador) 0x440a Spanish (Guatemala) 0x100a
Spanish (Honduras) 0x480a Spanish (Mexican) 0x080a Spanish (Modern Sort) 0x0c0a
Spanish (Nicaragua) 0x4c0a Spanish (Panama) 0x180a Spanish (Paraguay) 0x3c0a
Spanish (Peru) 0x280a Spanish (Puerto Rico) 0x500a Spanish (Traditional Sort) 0x040a
Spanish (Uruguay) 0x380a Spanish (Venezuela) 0x200a Swahili 0x0441
Swedish 0x041d Swedish (Finland) 0x081d Thai 0x041e
Turkish 0x041f Ukrainian 0x0422    

Several MSWebDVD methods and properties return locale identifier (LCID) values that identify which languages are available on the soundtracks or subtitles. To make use of this information, your application will need to extract the primary language ID from the returned LCID. To do this, perform a bitwise AND operation on the value of iLCID and 0x3FF. (The primary language ID is contained in the least significant 10 bits of the LCID.) The following code snippet shows how to do this.

iPrimaryLang = iLCID & 0x3FF;

To obtain a human-readable string from the primary language ID, call GetLangFromLangID as shown in this example:

sLanguage = DVD.GetLangFromLangID(iPrimaryLang);

See the Microsoft® Platform SDK for more information on LCIDs and language identifiers.

The following table lists the primary language IDs for the LCIDs in the table above.

Some Valid Primary Language IDs

Afrikaans 0x36 Albanian 0x1c Arabic 0x01 Basque 0x2d
Belarusian 0x23 Bulgarian 0x02 Catalan 0x03 Chinese 0x04
Croatian 0x1a Czech 0x05 Danish 0x06 Dutch 0x13
English 0x09 Estonian 0x25 Faeroese 0x38 Farsi 0x29
Finnish 0x0b French 0x0c German 0x07 Greek 0x08
Hebrew 0x0d Hungarian 0x0e Icelandic 0x0f Indonesian 0x21
Italian 0x10 Japanese 0x11 Korean 0x12 Latvian 0x26
Lithuanian 0x27 Malay 0x3e Norwegian 0x14 Polish 0x15
Portuguese 0x16 Romanian 0x18 Russian 0x19 Serbian 0x1a
Slovak 0x1b Slovenian 0x24 Spanish 0x0a Swahili 0x41
Swedish 0x1d Thai 0x1e Turkish 0x1f Ukrainian 0x22