Attribute VB_Name = "modLcidCp" '------------------------------------------ ' (c) 1999 Trigeminal Software, Inc. All Rights Reserved '------------------------------------------ Option Explicit Option Compare Text '------------------------------------------------------------ ' LCID code for FE and other countries ' ' NOTE: These could also be derived from Lang Id, SubLang Id, and Sort ' ' CONSIDER: If we plan to move to using the system or user-defined LCIDs, ' we must use either LangIds or Primary langIds since the LCIDs include the ' sort constant and we do not currently check each langauge with all sort choices '------------------------------------------------------------ Global Const LCID_ENGLISH_UK = &H809 Global Const LCID_ENGLICH_CANADA = &H1009 Global Const LCID_ENGLISH_NZ = &H1409 Global Const LCID_ENGLISH_AUSTRALIA = &HC09 Global Const LCID_ENGLISH_IRELAND = &H1809 Global Const LCID_ENGLISH_SOUTHAFRICA = &H1C09 Global Const LCID_PORTUGUESE_STANDARD = &H816 Global Const LCID_PORTUGUESE_BRAZIL = &H416 Global Const LCID_US = &H409 Global Const LCID_KK = &H411 Global Const LCID_TC = &H404 Global Const LCID_CH = &H412 Global Const LCID_PRC = &H804 '------------------------------------------------------------ ' Language IDs (from WINNT.H) '------------------------------------------------------------ Global Const LANG_NEUTRAL = &H0 Global Const LANG_AFRIKAANS = &H36 Global Const LANG_ALBANIAN = &H1C Global Const LANG_ARABIC = &H1 Global Const LANG_ARMENIAN = &H2B Global Const LANG_ASSAMESE = &H4D Global Const LANG_AZERI = &H2C Global Const LANG_BASQUE = &H2D Global Const LANG_BELARUSIAN = &H23 Global Const LANG_BENGALI = &H45 Global Const LANG_BULGARIAN = &H2 Global Const LANG_CATALAN = &H3 Global Const LANG_CHINESE = &H4 Global Const LANG_CROATIAN = &H1A Global Const LANG_CZECH = &H5 Global Const LANG_DANISH = &H6 Global Const LANG_DUTCH = &H13 Global Const LANG_ENGLISH = &H9 Global Const LANG_ESTONIAN = &H25 Global Const LANG_FAEROESE = &H38 Global Const LANG_FARSI = &H29 Global Const LANG_FINNISH = &HB Global Const LANG_FRENCH = &HC Global Const LANG_GEORGIAN = &H37 Global Const LANG_GERMAN = &H7 Global Const LANG_GREEK = &H8 Global Const LANG_GUJARATI = &H47 Global Const LANG_HEBREW = &HD Global Const LANG_HINDI = &H39 Global Const LANG_HUNGARIAN = &HE Global Const LANG_ICELANDIC = &HF Global Const LANG_INDONESIAN = &H21 Global Const LANG_ITALIAN = &H10 Global Const LANG_JAPANESE = &H11 Global Const LANG_KANNADA = &H4B Global Const LANG_KASHMIRI = &H60 Global Const LANG_KAZAK = &H3F Global Const LANG_KONKANI = &H57 Global Const LANG_KOREAN = &H12 Global Const LANG_LATVIAN = &H26 Global Const LANG_LITHUANIAN = &H27 Global Const LANG_MACEDONIAN = &H2F ' the Former Yugoslav Republic of Macedonia Global Const LANG_MALAY = &H3E Global Const LANG_MALAYALAM = &H4C Global Const LANG_MANIPURI = &H58 Global Const LANG_MARATHI = &H4E Global Const LANG_NEPALI = &H61 Global Const LANG_NORWEGIAN = &H14 Global Const LANG_ORIYA = &H48 Global Const LANG_POLISH = &H15 Global Const LANG_PORTUGUESE = &H16 Global Const LANG_PUNJABI = &H46 Global Const LANG_ROMANIAN = &H18 Global Const LANG_RUSSIAN = &H19 Global Const LANG_SANSKRIT = &H4F Global Const LANG_SERBIAN = &H1A Global Const LANG_SINDHI = &H59 Global Const LANG_SLOVAK = &H1B Global Const LANG_SLOVENIAN = &H24 Global Const LANG_SPANISH = &HA Global Const LANG_SWAHILI = &H41 Global Const LANG_SWEDISH = &H1D Global Const LANG_TAMIL = &H49 Global Const LANG_TATAR = &H44 Global Const LANG_TELUGU = &H4A Global Const LANG_THAI = &H1E Global Const LANG_TURKISH = &H1F Global Const LANG_UKRAINIAN = &H22 Global Const LANG_URDU = &H20 Global Const LANG_UZBEK = &H43 Global Const LANG_VIETNAMESE = &H2A Global Const LANG_YIDDISH = &H3D '------------------------------------------------------------ ' Sublanguage IDs. ' ' The name immediately following SUBLANG_ dictates which primary language ID that ' sublanguage ID can be combined with to form a valid language ID. '------------------------------------------------------------ Global Const SUBLANG_NEUTRAL = &H0 ' language neutral Global Const SUBLANG_DEFAULT = &H1 ' user default Global Const SUBLANG_SYS_DEFAULT = &H2 ' system default Global Const SUBLANG_ARABIC_SAUDI_ARABIA = &H1 ' Arabic (Saudi Arabia) Global Const SUBLANG_ARABIC_IRAQ = &H2 ' Arabic (Iraq) Global Const SUBLANG_ARABIC_EGYPT = &H3 ' Arabic (Egypt) Global Const SUBLANG_ARABIC_LIBYA = &H4 ' Arabic (Libya) Global Const SUBLANG_ARABIC_ALGERIA = &H5 ' Arabic (Algeria) Global Const SUBLANG_ARABIC_MOROCCO = &H6 ' Arabic (Morocco) Global Const SUBLANG_ARABIC_TUNISIA = &H7 ' Arabic (Tunisia) Global Const SUBLANG_ARABIC_OMAN = &H8 ' Arabic (Oman) Global Const SUBLANG_ARABIC_YEMEN = &H9 ' Arabic (Yemen) Global Const SUBLANG_ARABIC_SYRIA = &HA ' Arabic (Syria) Global Const SUBLANG_ARABIC_JORDAN = &HB ' Arabic (Jordan) Global Const SUBLANG_ARABIC_LEBANON = &HC ' Arabic (Lebanon) Global Const SUBLANG_ARABIC_KUWAIT = &HD ' Arabic (Kuwait) Global Const SUBLANG_ARABIC_UAE = &HE ' Arabic (U.A.E) Global Const SUBLANG_ARABIC_BAHRAIN = &HF ' Arabic (Bahrain) Global Const SUBLANG_ARABIC_QATAR = &H10 ' Arabic (Qatar) Global Const SUBLANG_AZERI_LATIN = &H1 ' Azeri (Latin) Global Const SUBLANG_AZERI_CYRILLIC = &H2 ' Azeri (Cyrillic) Global Const SUBLANG_CHINESE_TRADITIONAL = &H1 ' Chinese (Taiwan) Global Const SUBLANG_CHINESE_SIMPLIFIED = &H2 ' Chinese (PR China) Global Const SUBLANG_CHINESE_HONGKONG = &H3 ' Chinese (Hong Kong S.A.R., P.R.C.) Global Const SUBLANG_CHINESE_SINGAPORE = &H4 ' Chinese (Singapore) Global Const SUBLANG_CHINESE_MACAU = &H5 ' Chinese (Macau) Global Const SUBLANG_DUTCH = &H1 ' Dutch Global Const SUBLANG_DUTCH_BELGIAN = &H2 ' Dutch (Belgian) Global Const SUBLANG_ENGLISH_US = &H1 ' English (USA) Global Const SUBLANG_ENGLISH_UK = &H2 ' English (UK) Global Const SUBLANG_ENGLISH_AUS = &H3 ' English (Australian) Global Const SUBLANG_ENGLISH_CAN = &H4 ' English (Canadian) Global Const SUBLANG_ENGLISH_NZ = &H5 ' English (New Zealand) Global Const SUBLANG_ENGLISH_EIRE = &H6 ' English (Irish) Global Const SUBLANG_ENGLISH_SOUTH_AFRICA = &H7 ' English (South Africa) Global Const SUBLANG_ENGLISH_JAMAICA = &H8 ' English (Jamaica) Global Const SUBLANG_ENGLISH_CARIBBEAN = &H9 ' English (Caribbean) Global Const SUBLANG_ENGLISH_BELIZE = &HA ' English (Belize) Global Const SUBLANG_ENGLISH_TRINIDAD = &HB ' English (Trinidad) Global Const SUBLANG_ENGLISH_ZIMBABWE = &HC ' English (Zimbabwe) Global Const SUBLANG_ENGLISH_PHILIPPINES = &HD ' English (Philippines) Global Const SUBLANG_FRENCH = &H1 ' French Global Const SUBLANG_FRENCH_BELGIAN = &H2 ' French (Belgian) Global Const SUBLANG_FRENCH_CANADIAN = &H3 ' French (Canadian) Global Const SUBLANG_FRENCH_SWISS = &H4 ' French (Swiss) Global Const SUBLANG_FRENCH_LUXEMBOURG = &H5 ' French (Luxembourg) Global Const SUBLANG_FRENCH_MONACO = &H6 ' French (Monaco) Global Const SUBLANG_GERMAN = &H1 ' German Global Const SUBLANG_GERMAN_SWISS = &H2 ' German (Swiss) Global Const SUBLANG_GERMAN_AUSTRIAN = &H3 ' German (Austrian) Global Const SUBLANG_GERMAN_LUXEMBOURG = &H4 ' German (Luxembourg) Global Const SUBLANG_GERMAN_LIECHTENSTEIN = &H5 ' German (Liechtenstein) Global Const SUBLANG_ITALIAN = &H1 ' Italian Global Const SUBLANG_ITALIAN_SWISS = &H2 ' Italian (Swiss) Global Const SUBLANG_KASHMIRI_INDIA = &H2 ' Kashmiri (India) Global Const SUBLANG_KOREAN = &H1 ' Korean (Extended Wansung) Global Const SUBLANG_LITHUANIAN = &H1 ' Lithuanian Global Const SUBLANG_MALAY_MALAYSIA = &H1 ' Malay (Malaysia) Global Const SUBLANG_MALAY_BRUNEI_DARUSSALAM = &H2 ' Malay (Brunei Darussalam) Global Const SUBLANG_NEPALI_INDIA = &H2 ' Nepali (India) Global Const SUBLANG_NORWEGIAN_BOKMAL = &H1 ' Norwegian (Bokmal) Global Const SUBLANG_NORWEGIAN_NYNORSK = &H2 ' Norwegian (Nynorsk) Global Const SUBLANG_PORTUGUESE = &H2 ' Portuguese Global Const SUBLANG_PORTUGUESE_BRAZILIAN = &H1 ' Portuguese (Brazilian) Global Const SUBLANG_SERBIAN_LATIN = &H2 ' Serbian (Latin) Global Const SUBLANG_SERBIAN_CYRILLIC = &H3 ' Serbian (Cyrillic) Global Const SUBLANG_SPANISH = &H1 ' Spanish (Castilian) Global Const SUBLANG_SPANISH_MEXICAN = &H2 ' Spanish (Mexican) Global Const SUBLANG_SPANISH_MODERN = &H3 ' Spanish (Modern) Global Const SUBLANG_SPANISH_GUATEMALA = &H4 ' Spanish (Guatemala) Global Const SUBLANG_SPANISH_COSTA_RICA = &H5 ' Spanish (Costa Rica) Global Const SUBLANG_SPANISH_PANAMA = &H6 ' Spanish (Panama) Global Const SUBLANG_SPANISH_DOMINICAN_REPUBLIC = &H7 ' Spanish (Dominican Republic) Global Const SUBLANG_SPANISH_VENEZUELA = &H8 ' Spanish (Venezuela) Global Const SUBLANG_SPANISH_COLOMBIA = &H9 ' Spanish (Colombia) Global Const SUBLANG_SPANISH_PERU = &HA ' Spanish (Peru) Global Const SUBLANG_SPANISH_ARGENTINA = &HB ' Spanish (Argentina) Global Const SUBLANG_SPANISH_ECUADOR = &HC ' Spanish (Ecuador) Global Const SUBLANG_SPANISH_CHILE = &HD ' Spanish (Chile) Global Const SUBLANG_SPANISH_URUGUAY = &HE ' Spanish (Uruguay) Global Const SUBLANG_SPANISH_PARAGUAY = &HF ' Spanish (Paraguay) Global Const SUBLANG_SPANISH_BOLIVIA = &H10 ' Spanish (Bolivia) Global Const SUBLANG_SPANISH_EL_SALVADOR = &H11 ' Spanish (El Salvador) Global Const SUBLANG_SPANISH_HONDURAS = &H12 ' Spanish (Honduras) Global Const SUBLANG_SPANISH_NICARAGUA = &H13 ' Spanish (Nicaragua) Global Const SUBLANG_SPANISH_PUERTO_RICO = &H14 ' Spanish (Puerto Rico) Global Const SUBLANG_SWEDISH = &H1 ' Swedish Global Const SUBLANG_SWEDISH_FINLAND = &H2 ' Swedish (Finland) Global Const SUBLANG_URDU_PAKISTAN = &H1 ' Urdu (Pakistan) Global Const SUBLANG_URDU_INDIA = &H2 ' Urdu (India) Global Const SUBLANG_UZBEK_LATIN = &H1 ' Uzbek (Latin) Global Const SUBLANG_UZBEK_CYRILLIC = &H2 ' Uzbek (Cyrillic) Global Const NLS_VALID_LOCALE_MASK = &HFFFFF '------------------------------------------------------------ ' Sorting IDs. (from WINNT.H) '------------------------------------------------------------ Global Const SORT_DEFAULT = &H0 ' sorting default Global Const SORT_JAPANESE_XJIS = &H0 ' Japanese XJIS order Global Const SORT_JAPANESE_UNICODE = &H1 ' Japanese Unicode order Global Const SORT_CHINESE_BIG5 = &H0 ' Chinese BIG5 order Global Const SORT_CHINESE_PRCP = &H0 ' PRC Chinese Phonetic order Global Const SORT_CHINESE_UNICODE = &H1 ' Chinese Unicode order Global Const SORT_CHINESE_PRC = &H2 ' PRC Chinese Stroke Count order Global Const SORT_KOREAN_KSC = &H0 ' Korean KSC order Global Const SORT_KOREAN_UNICODE = &H1 ' Korean Unicode order Global Const SORT_GERMAN_PHONE_BOOK = &H1 ' German Phone Book order Global Const SORT_HUNGARIAN_DEFAULT = &H0 ' Hungarian Default order Global Const SORT_HUNGARIAN_TECHNICAL = &H1 ' Hungarian Technical order Global Const SORT_GEORGIAN_TRADITIONAL = &H0 ' Georgian Traditional order Global Const SORT_GEORGIAN_MODERN = &H1 ' Georgian Modern order '------------------------------------------------------------ ' Derived System and User IDs LangIds and LCIDs (from WINNT.H) '------------------------------------------------------------ Global Const LANG_SYSTEM_DEFAULT = 40& ' MakeLangId(LANGNEUTRAL, SUBLANGSYS_DEFAULT) Global Const LANG_USER_DEFAULT = 20& ' MakeLangId(LANGNEUTRAL, SUBLANGDEFAULT) Global Const LOCALE_SYSTEM_DEFAULT = 40& ' MakeLcid(LANG_SYSTEM_DEFAULT, SORT_DEFAULT) Global Const LOCALE_USER_DEFAULT = 20& ' MakeLcid(LANG_USER_DEFAULT, SORT_DEFAULT) Global Const LOCALE_NEUTRAL = 0& ' MakeLcid(MakeLangId(LANGNEUTRAL, SUBLANGNEUTRAL), SORT_DEFAULT) '------------------------------------------------------------ ' Character set ID code From wingdi.h '------------------------------------------------------------ Global Const ANSI_CHARSET = 0 'US Global Const SHIFTJIS_CHARSET = 128 'KK Global Const CHINESEBIG5_CHARSET = 136 'TC Global Const HANGEUL_CHARSET = 129 'CH Global Const GB2312_CHARSET = 134 'PRC Global Const DEFAULT_CHARSET = 1 Global Const SYMBOL_CHARSET = 2 Global Const OEM_CHARSET = 255 Global Const JOHAB_CHARSET = 130 Global Const HEBREW_CHARSET = 177 Global Const ARABIC_CHARSET = 178 Global Const GREEK_CHARSET = 161 Global Const TURKISH_CHARSET = 162 Global Const VIETNAMESE_CHARSET = 163 Global Const THAI_CHARSET = 222 Global Const EASTEUROPE_CHARSET = 238 Global Const RUSSIAN_CHARSET = 204 Global Const MAC_CHARSET = 77 Global Const BALTIC_CHARSET = 186 '------------------------------------------------------------ ' Language IDs, clipped from a random header file whose name I cannot remeber, ' or derived. Note that you can build these yourself any time you like using the ' constants and procs in this module. '------------------------------------------------------------ Global Const LidUnknown = &HFFFF Global Const LidNone = &H0 Global Const LidNoProof = &H400 Global Const LidArabic = &H401 Global Const LidDanish = &H406 Global Const LidGerman = &H407 Global Const LidSwissGerman = &H807 Global Const LidAmerican = &H409 Global Const LidBritish = &H809 Global Const LidAustralian = &HC09 Global Const LidSpanish = &H40A Global Const LidFinnish = &H40B Global Const LidFrench = &H40C Global Const LidFrenchCanadian = &HC0C Global Const LidHebrew = &H40D Global Const LidItalian = &H410 Global Const LidDutch = &H413 Global Const LidDutchPreferred = &H13 Global Const LidDutchBelgian = &H813 Global Const LidNorskBokmal = &H414 Global Const LidNorskNynorsk = &H814 Global Const LidPortBrazil = &H416 Global Const LidPortIberian = &H816 Global Const LidSwedish = &H41D Global Const LidCatalan = &H403 Global Const LidRussian = &H419 Global Const LidCzech = &H405 Global Const LidHungarian = &H40E Global Const LidPolish = &H415 Global Const LidJapanese = &H411 Global Const LidKorean = &H412 Global Const LidTaiwan = &H404 Global Const LidChina = &H804 Global Const LidTurkish = &H41F Global Const LidGreek = &H408 Global Const LidBasque = &H42D Global Const LidSlovenian = &H424 Global Const LidMalaysian = &H43E Global Const LidAfrikaans = &H436 Global Const LidBulgarian = &H402 Global Const LidCroatian = &H41A Global Const LidEstonian = &H425 Global Const LidLatvian = &H426 Global Const LidLithuanian = &H427 Global Const LidMacedonian = &H42F Global Const LidRomanian = &H418 Global Const LidSerbianCyrillic = &HC1A Global Const LidSerbianLatin = &H81A Global Const LidByelorussian = &H423 Global Const LidSlovak = &H41B Global Const LidUkrainian = &H422 Global Const LidIcelandic = &H40F Global Const LidVietnamese = &H42A ' (LANGVIETNAMESE, SUBLANGDEFAULT) Global Const LidThai = &H41E Public Declare Function GetUserDefLCID Lib "Kernel32" Alias "GetUserDefaultLCID" () As Long Public Declare Function GetSystemDefLCID Lib "Kernel32" Alias "GetSystemDefaultLCID" () As Long ' Language IDs. ' ' The following two combinations of primary language ID and ' sublanguage ID have special semantics: ' ' Primary Language ID Sublanguage ID Result ' ------------------- --------------- ------------------------ ' LANG_NEUTRAL SUBLANG_NEUTRAL Language neutral ' LANG_NEUTRAL SUBLANG_DEFAULT User default language ' LANG_NEUTRAL SUBLANG_SYS_DEFAULT System default language '---------------------------------------------------------------------- ' A language ID is a 16 bit value which is the combination of a ' primary language ID and a secondary language ID. The bits are ' allocated as follows: ' ' +-----------------------+-------------------------+ ' | Sublanguage ID | Primary Language ID | ' +-----------------------+-------------------------+ ' 15 10 9 0 bit '---------------------------------------------------------------------- '---------------------------------------------------------------------- ' MakeLangId ' ' ' VB version of the C++ MAKELANGID macro - construct language id from a primary language id and a sublanguage id. ' global const MAKELANGID(p, s) ((((WORD )(s)) << 10) | (WORD )(p)) '---------------------------------------------------------------------- Public Function MakeLangId(ByVal lgidPrimary As Long, ByVal lgidSub As Long) As Long MakeLangId = (LLeftShift(lgidSub, 10) Or lgidPrimary) End Function '---------------------------------------------------------------------- ' PrimaryLangId ' ' ' VB version of the C++ PRIMARYLANGID macro - extract primary language id from a language id. ' global const PRIMARYLANGID(lgid) ((WORD )(lgid) & 0x3ff) '---------------------------------------------------------------------- Public Function PrimaryLangId(ByVal lgid As Long) As Long PrimaryLangId = (lgid And &H3FF) End Function '---------------------------------------------------------------------- ' SubLangId ' ' ' VB version of the C++ SUBLANGID macro - extract sublanguage id from a language id. ' global const SUBLANGID(lgid) ((WORD )(lgid) >> 10) '---------------------------------------------------------------------- Public Function SubLangId(ByVal lgid As Long) As Long SubLangId = LRightShift(lgid, 10) End Function '---------------------------------------------------------------------- ' A locale ID is a 32 bit value which is the combination of a language ID, a sort ID, ' and a reserved area. The bits are allocated as follows: ' ' +-------------+---------+-------------------------+ ' | Reserved | Sort ID | Language ID | ' +-------------+---------+-------------------------+ ' 31 20 19 16 15 0 bit ' '---------------------------------------------------------------------- '---------------------------------------------------------------------- ' SortIdFromLcid ' ' ' VB version of the C++ SORTIDFROMLCID macro - extract sort id from a locale id. ' global const SORTIDFROMLCID(lcid) ((WORD )((((DWORD)(lcid)) & NLS_VALID_LOCALE_MASK) >> 16)) '---------------------------------------------------------------------- Public Function SortIdFromLcid(ByVal lcid As Long) As Long SortIdFromLcid = LRightShift((lcid And NLS_VALID_LOCALE_MASK), 16) End Function '---------------------------------------------------------------------- ' LangIdFromLcid ' ' ' VB version of the C++ LANGIDFROMLCID macro - extract language id from a locale id. ' global const LANGIDFROMLCID(lcid) ((WORD )(lcid)) '---------------------------------------------------------------------- Public Function LangIdFromLcid(ByVal lcid As Long) As Long LangIdFromLcid = lcid And 65535 End Function '---------------------------------------------------------------------- ' MakeLcid ' ' ' VB version of the C++ MAKELCID macro - construct locale id from a language id and a sort id. ' global const MAKELCID(lgid, srtid) ((DWORD)((((DWORD)((WORD )(srtid))) << 16) | ((DWORD)((WORD )(lgid))))) '---------------------------------------------------------------------- Public Function MakeLcid(ByVal lgid As Integer, ByVal srtid As Integer) As Long MakeLcid = (LLeftShift(srtid, 16) Or lgid) End Function '---------------------------------------------------------------------- ' LLeftShift ' ' Since VB does not have a left shift operator ' LLeftShift(8,2) is equivalent to 8 << 2 '---------------------------------------------------------------------- Public Function LLeftShift(ByVal lNum As Long, ByVal lShift As Long) As Long LLeftShift = lNum * (2 ^ lShift) End Function '---------------------------------------------------------------------- ' LRightShift ' ' Since VB does not have a right shift operator ' LRightShift(8,2) is equivalent to 8 >> 2 '---------------------------------------------------------------------- Public Function LRightShift(ByVal lNum As Long, ByVal lShift As Long) As Long LRightShift = lNum / (2 ^ lShift) End Function '---------------------------------------------------------------------- ' GetPLId ' ' Gives the primary language ID from the user's control panel settings '---------------------------------------------------------------------- Public Function GetPLId() As Long GetPLId = PrimaryLangId(LangIdFromLcid(GetUserDefLCID())) End Function '---------------------------------------------------------------------- ' GetLId ' ' Gives the Language ID from the user's control panel settings '---------------------------------------------------------------------- Public Function GetLId() As Long GetLId = LangIdFromLcid(GetUserDefLCID()) End Function '--------------------------------------------------- ' CharSetOfLid ' ' This function returns the Font CharSet to use. The caller specifies whether to use ' the language of the DLL (as in UI elements) or the language of the control panel (as in ' edit controls). Note that if the passed in lcid is 1033, we still check the control panel, ' because the low 128 of the ANSI charset is in all others anyway, and this scheme allows ' support for three important scenarios: ' 1) US on US (1033 used all the time since it is both DLL and CP lang) ' 2) US on Intl platforms ' 3) Intl Platforms on US ' We do fail pretty badly in some cases of one intl platform on a different intl ' platform control panel setting, but you cannot have everything. '--------------------------------------------------- Public Property Get CharSetOfLid(Optional lcid As Long = 1033) As Long Dim cs As Long Dim lid As Long Dim lidIn As Long lidIn = LangIdFromLcid(lcid) If lidIn = LidAmerican Then lid = LangIdFromLcid(GetUserDefLCID()) Else lid = lidIn End If Select Case lid Case LidAfrikaans, LidDanish, LidGerman, LidSwissGerman, LidAmerican, LidBritish, LidAustralian, LidSpanish, LidFinnish, LidFrench, _ LidFrenchCanadian, LidItalian, LidDutch, LidDutchPreferred, LidNorskBokmal, LidNorskNynorsk, LidPortBrazil, LidPortIberian, _ LidSwedish, LidCatalan, LidBasque, LidIcelandic, LidMalaysian cs = ANSI_CHARSET Case LidEstonian, LidLatvian, LidLithuanian cs = BALTIC_CHARSET Case LidArabic cs = ARABIC_CHARSET Case LidHebrew cs = HEBREW_CHARSET Case LidRussian, LidByelorussian, LidBulgarian, LidSerbianCyrillic, LidUkrainian cs = RUSSIAN_CHARSET Case LidCzech, LidHungarian, LidPolish, LidCroatian, LidMacedonian, LidRomanian, LidSerbianLatin, LidSlovak, LidSlovenian cs = EASTEUROPE_CHARSET Case LidTurkish cs = TURKISH_CHARSET Case LidGreek cs = GREEK_CHARSET Case LidJapanese cs = SHIFTJIS_CHARSET Case LidKorean cs = HANGEUL_CHARSET Case LidChina cs = GB2312_CHARSET Case LidTaiwan cs = CHINESEBIG5_CHARSET Case LidVietnamese cs = VIETNAMESE_CHARSET Case LidUnknown, LidNoProof cs = DEFAULT_CHARSET End Select CharSetOfLid = cs End Property