Source Code for lcid.asp

COLOR LEGEND
Server Side Script
Client Side Script
Hyperlink
Include
Frames
Comments
Object Code Link
Standard HTML and Text


<SCRIPT  LANGUAGE="JScript" RUNAT="SERVER">
//
// 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
//

//
// Primary language IDs.
//

var LANG_NEUTRAL = 0x00;

var LANG_AFRIKAANS = 0x36;
var LANG_ALBANIAN = 0x1c;
var LANG_ARABIC = 0x01;
var LANG_BASQUE = 0x2d;
var LANG_BELARUSIAN = 0x23;
var LANG_BULGARIAN = 0x02;
var LANG_CATALAN = 0x03;
var LANG_CHINESE = 0x04;
var LANG_CROATIAN = 0x1a;
var LANG_CZECH = 0x05;
var LANG_DANISH = 0x06;
var LANG_DUTCH = 0x13;
var LANG_ENGLISH = 0x09;
var LANG_ESTONIAN = 0x25;
var LANG_FAEROESE = 0x38;
var LANG_FARSI = 0x29;
var LANG_FINNISH = 0x0b;
var LANG_FRENCH = 0x0c;
var LANG_GERMAN = 0x07;
var LANG_GREEK = 0x08;
var LANG_HEBREW = 0x0d;
var LANG_HUNGARIAN = 0x0e;
var LANG_ICELANDIC = 0x0f;
var LANG_INDONESIAN = 0x21;
var LANG_ITALIAN = 0x10;
var LANG_JAPANESE = 0x11;
var LANG_KOREAN = 0x12;
var LANG_LATVIAN = 0x26;
var LANG_LITHUANIAN = 0x27;
var LANG_NORWEGIAN = 0x14;
var LANG_POLISH = 0x15;
var LANG_PORTUGUESE = 0x16;
var LANG_ROMANIAN = 0x18;
var LANG_RUSSIAN = 0x19;
var LANG_SERBIAN = 0x1a;
var LANG_SLOVAK = 0x1b;
var LANG_SLOVENIAN = 0x24;
var LANG_SPANISH = 0x0a;
var LANG_SWEDISH = 0x1d;
var LANG_THAI = 0x1e;
var LANG_TURKISH = 0x1f;
var LANG_UKRAINIAN = 0x22;
var LANG_VIETNAMESE = 0x2a;

//
// 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.
//

var SUBLANG_NEUTRAL = 0x00; // language neutral

var SUBLANG_DEFAULT = 0x01; // user default
var SUBLANG_SYS_DEFAULT = 0x02; // system default
var SUBLANG_ARABIC_SAUDI_ARABIA = 0x01; // Arabic (Saudi Arabia)
var SUBLANG_ARABIC_IRAQ = 0x02; // Arabic (Iraq)
var SUBLANG_ARABIC_EGYPT = 0x03; // Arabic (Egypt)
var SUBLANG_ARABIC_LIBYA = 0x04; // Arabic (Libya)
var SUBLANG_ARABIC_ALGERIA = 0x05; // Arabic (Algeria)
var SUBLANG_ARABIC_MOROCCO = 0x06; // Arabic (Morocco)
var SUBLANG_ARABIC_TUNISIA = 0x07; // Arabic (Tunisia)
var SUBLANG_ARABIC_OMAN = 0x08; // Arabic (Oman)
var SUBLANG_ARABIC_YEMEN = 0x09; // Arabic (Yemen)
var SUBLANG_ARABIC_SYRIA = 0x0a; // Arabic (Syria)
var SUBLANG_ARABIC_JORDAN = 0x0b; // Arabic (Jordan)
var SUBLANG_ARABIC_LEBANON = 0x0c; // Arabic (Lebanon)
var SUBLANG_ARABIC_KUWAIT = 0x0d; // Arabic (Kuwait)
var SUBLANG_ARABIC_UAE = 0x0e; // Arabic (U.A.E)
var SUBLANG_ARABIC_BAHRAIN = 0x0f; // Arabic (Bahrain)
var SUBLANG_ARABIC_QATAR = 0x10; // Arabic (Qatar)
var SUBLANG_CHINESE_TRADITIONAL = 0x01; // Chinese (Taiwan)
var SUBLANG_CHINESE_SIMPLIFIED = 0x02; // Chinese (PR China)
var SUBLANG_CHINESE_HONGKONG = 0x03; // Chinese (Hong Kong)
var SUBLANG_CHINESE_SINGAPORE = 0x04; // Chinese (Singapore)
var SUBLANG_DUTCH = 0x01; // Dutch
var SUBLANG_DUTCH_BELGIAN = 0x02; // Dutch (Belgian)
var SUBLANG_ENGLISH_US = 0x01; // English (USA)
var SUBLANG_ENGLISH_UK = 0x02; // English (UK)
var SUBLANG_ENGLISH_AUS = 0x03; // English (Australian)
var SUBLANG_ENGLISH_CAN = 0x04; // English (Canadian)
var SUBLANG_ENGLISH_NZ = 0x05; // English (New Zealand)
var SUBLANG_ENGLISH_EIRE = 0x06; // English (Irish)
var SUBLANG_ENGLISH_SOUTH_AFRICA = 0x07; // English (South Africa)
var SUBLANG_ENGLISH_JAMAICA = 0x08; // English (Jamaica)
var SUBLANG_ENGLISH_CARIBBEAN = 0x09; // English (Caribbean)
var SUBLANG_ENGLISH_BELIZE = 0x0a; // English (Belize)
var SUBLANG_ENGLISH_TRINIDAD = 0x0b; // English (Trinidad)
var SUBLANG_FRENCH = 0x01; // French
var SUBLANG_FRENCH_BELGIAN = 0x02; // French (Belgian)
var SUBLANG_FRENCH_CANADIAN = 0x03; // French (Canadian)
var SUBLANG_FRENCH_SWISS = 0x04; // French (Swiss)
var SUBLANG_FRENCH_LUXEMBOURG = 0x05; // French (Luxembourg)
var SUBLANG_GERMAN = 0x01; // German
var SUBLANG_GERMAN_SWISS = 0x02; // German (Swiss)
var SUBLANG_GERMAN_AUSTRIAN = 0x03; // German (Austrian)
var SUBLANG_GERMAN_LUXEMBOURG = 0x04; // German (Luxembourg)
var SUBLANG_GERMAN_LIECHTENSTEIN = 0x05; // German (Liechtenstein)
var SUBLANG_ITALIAN = 0x01; // Italian
var SUBLANG_ITALIAN_SWISS = 0x02; // Italian (Swiss)
var SUBLANG_KOREAN = 0x01; // Korean (Extended Wansung)
var SUBLANG_KOREAN_JOHAB = 0x02; // Korean (Johab)
var SUBLANG_NORWEGIAN_BOKMAL = 0x01; // Norwegian (Bokmal)
var SUBLANG_NORWEGIAN_NYNORSK = 0x02; // Norwegian (Nynorsk)
var SUBLANG_PORTUGUESE = 0x02; // Portuguese
var SUBLANG_PORTUGUESE_BRAZILIAN = 0x01; // Portuguese (Brazilian)
var SUBLANG_SERBIAN_LATIN = 0x02; // Serbian (Latin)
var SUBLANG_SERBIAN_CYRILLIC = 0x03; // Serbian (Cyrillic)
var SUBLANG_SPANISH = 0x01; // Spanish (Castilian)
var SUBLANG_SPANISH_MEXICAN = 0x02; // Spanish (Mexican)
var SUBLANG_SPANISH_MODERN = 0x03; // Spanish (Modern)
var SUBLANG_SPANISH_GUATEMALA = 0x04; // Spanish (Guatemala)
var SUBLANG_SPANISH_COSTA_RICA = 0x05; // Spanish (Costa Rica)
var SUBLANG_SPANISH_PANAMA = 0x06; // Spanish (Panama)
var SUBLANG_SPANISH_DOMINICAN_REPUBLIC = 0x07; // Spanish (Dominican Republic)
var SUBLANG_SPANISH_VENEZUELA = 0x08; // Spanish (Venezuela)
var SUBLANG_SPANISH_COLOMBIA = 0x09; // Spanish (Colombia)
var SUBLANG_SPANISH_PERU = 0x0a; // Spanish (Peru)
var SUBLANG_SPANISH_ARGENTINA = 0x0b; // Spanish (Argentina)
var SUBLANG_SPANISH_ECUADOR = 0x0c; // Spanish (Ecuador)
var SUBLANG_SPANISH_CHILE = 0x0d; // Spanish (Chile)
var SUBLANG_SPANISH_URUGUAY = 0x0e; // Spanish (Uruguay)
var SUBLANG_SPANISH_PARAGUAY = 0x0f; // Spanish (Paraguay)
var SUBLANG_SPANISH_BOLIVIA = 0x10; // Spanish (Bolivia)
var SUBLANG_SPANISH_EL_SALVADOR = 0x11; // Spanish (El Salvador)
var SUBLANG_SPANISH_HONDURAS = 0x12; // Spanish (Honduras)
var SUBLANG_SPANISH_NICARAGUA = 0x13; // Spanish (Nicaragua)
var SUBLANG_SPANISH_PUERTO_RICO = 0x14; // Spanish (Puerto Rico)
var SUBLANG_SWEDISH = 0x01; // Swedish
var SUBLANG_SWEDISH_FINLAND = 0x02; // Swedish (Finland)

//
// Sorting IDs.
//

var SORT_DEFAULT = 0x0; // sorting default

var SORT_JAPANESE_XJIS = 0x0; // Japanese XJIS order
var SORT_JAPANESE_UNICODE = 0x1; // Japanese Unicode order

var SORT_CHINESE_BIG5 = 0x0; // Chinese BIG5 order
var SORT_CHINESE_PRCP = 0x0; // PRC Chinese Phonetic order
var SORT_CHINESE_UNICODE = 0x1; // Chinese Unicode order
var SORT_CHINESE_PRC = 0x2; // PRC Chinese Stroke Count order

var SORT_KOREAN_KSC = 0x0; // Korean KSC order
var SORT_KOREAN_UNICODE = 0x1; // Korean Unicode order

var SORT_GERMAN_PHONE_BOOK = 0x1; // German Phone Book order

//
// 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
//
//
// Language ID creation/extraction macros:
//
// MAKELANGID - construct language id from a primary language id and
// a sublanguage id.
// PRIMARYLANGID - extract primary language id from a language id.
// SUBLANGID - extract sublanguage id from a language id.

function MAKELANGID(p,s)
{
   return (((s) <<  10) | p);
}

function PRIMARYLANGID(lgid)
{
   return ((lgid) & 0x3ff);
}

function SUBLANGID(lgid)
{
   return ((lgid) >> 10);
}

//
// 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
//
//
// Locale ID creation/extraction macros:
//
// MAKELCID - construct locale id from a language id and a sort id.

function MAKELCID(lgid, srtid)
{
   return (((srtid) <<  16) | (lgid));
}

//
// Default System and User IDs for language and locale.
//

function LANG_SYSTEM_DEFAULT()
{
   return MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT);
}

function LANG_USER_DEFAULT()
{
   return MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);
}

function LOCALE_SYSTEM_DEFAULT()
{
   return MAKELCID(LANG_SYSTEM_DEFAULT, SORT_DEFAULT);
}

function LOCALE_USER_DEFAULT()
{
   return MAKELCID(LANG_USER_DEFAULT, SORT_DEFAULT);
}

function LOCALE_NEUTRAL()
{
   return MAKELCID(MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), SORT_DEFAULT);
}
</SCRIPT>