123HostNow - Support . Innovation . Quality
On Line Forum Be an Affiliate Terms of Service Contact Us Standard Premiere Premiere Silver Premiere Gold Knowledge Base Reseller Plans Live Demo Sign Up Now! Domain names Member Login Systems Status


Live Support
 

Session.LCID (LOCALE ID)

Properly Formatting International Websites.

If you have developed international web sites, you had to format dates, numbers, currecy, etc. yourself and relying on the version of Windows that was installed on the server was no good idea in case you moved sites from say The United States to a United Kingdom provider. With IIS4 and IIS5 (Windows NT4 and Windows 2000 respectively) you only need to set the LOCALE ID (Session.LCID) and everything is done for you. The Session.LCID is a read/write property, meaning you can assign a value to it as well as read its current value.

Session.LCID has session scope, which means you can just add one line of code to your global.asa file and ASP does the rest for you. Just remember that if you assign a new value to the Session.LCID it will override global.asa and will remain until a new value is set or the session is ended.
Below you can see locale id's for the US and the UK as well as how dates are formatted using these locales.


Session.LCID = 1033 'This is the English(United States) format.

  Short Date : 8/25/2004
  Long Date : Wednesday, August 25, 2004
  Time : 4:29:53 AM
  Currency : $9.95
  
Session.LCID = 2057 'This is the English(British) format

  Short Date : 25/08/2004
  Long Date : 25 August 2004
  Time : 04:29:53
  Currency : �10.00


When working with databases, you will want to also set the format of the date field to correspond with the LCID that is being used in the script. You can do this by going into the design view and setting the format to dd/mm/yyyy or the format you are using.

Below is a table of the LCIDs, and the corresponding language that you have available:

You can click the Locale ID numbers below to display the following values formatted accordingly. Default is English(US)
Short Date : 8/25/2004  Long Date : Wednesday, August 25, 2004
Currency : $10.00  Time : 4:29:53 AM
LOCALE ID :
LCID Language LCID Language
1078Afrikaans1052Albanian
5121Arabic(Algeria)15361Arabic(Bahrain)
3073Arabic(Egypt)2049Arabic(Iraq)
11265Arabic(Jordan)13313Arabic(Kuwait)
12289Arabic(Lebanon)4097Arabic(Libya)
6145Arabic(Morocco)8193Arabic(Oman)
16385Arabic(Qatar)1025Arabic(Saudi Arabia)
10241Arabic(Syria)7169Arabic(Tunisia)
14337Arabic(U.A.E.)9217Arabic(Yemen)
1069Basque1059Belarusian
1026Bulgarian1027Catalan
3076Chinese(Hong Kong)2052Chinese(PRC)
4100Chinese(Singapore)1028Chinese(Taiwan)
1050Croatian1029Czech
1030Danish2067Dutch(Belgian)
1043Dutch(Standard)9English
3081English(Australian)10249English(Belize)
2057English(British)4105English(Canadian)
9225English(Caribbean)6153English(Ireland)
8201English(Jamaica)5129English(New Zealand)
7177English(South Africa)11273English(Trinidad)
1033English(United States)1061Estonian
1080Faeroese1065Farsi
1035Finnish2060French(Belgian)
3084French(Canadian)5132French(Luxembourg)
1036French(Standard)4108French(Swiss)
2108Gaelic(Irish)1084Gaelic(Scots)
3079German(Austrian)5127German(Liechtenstein)
4103German(Luxembourg)1031German(Standard)
2055German(Swiss)1032Greek
1037Hebrew1081Hindi
1038Hungarian1039Icelandic
1057Indonesian1040Italian(Standard)
2064Italian(Swiss)1041Japanese
1042Korean2066Korean(Johab)
1062Latvian1063Lithuanian
1071Macedonian1086Malaysian
1082Maltese1044Norwegian(Bokmal)
2068Norwegian(Nynorsk)1045Polish
1046Portuguese(Brazilian)2070Portuguese(Standard)
1047Rhaeto-Romanic1048Romanian
2072Romanian(Moldavia)1049Russian
2073Russian(Moldavia)1083Sami(Lappish)
3098Serbian(Cyrillic)2074Serbian(Latin)
1051Slovak1060Slovenian
1070Sorbian11274Spanish(Argentina)
16394Spanish(Bolivia)13322Spanish(Chile)
9226Spanish(Colombia)5130Spanish(Costa Rica)
7178Spanish(Dominican Republic)12298Spanish(Ecuador)
17418Spanish(El Salvador)4106Spanish(Guatemala)
18442Spanish(Honduras)2058Spanish(Mexican)
19466Spanish(Nicaragua)6154Spanish(Panama)
15370Spanish(Paraguay)10250Spanish(Peru)
20490Spanish(Puerto Rico)3082Spanish,Spain-Modern Sort
1034Spanish(Spain - Traditional Sort)14346Spanish(Uruguay)
8202Spanish(Venezuela)1072Sutu
1053Swedish2077Swedish(Finland)
1054Thai1073Tsonga
1074Tswana1055Turkish
1058Ukrainian1056Urdu
1075Venda1066Vietnamese
1076Xhosa1085Yiddish
1077Zulu2048default

 

Send this article to a friend.

 

Powered By 
Windows Server 2003
Instant Setup!
All accounts are setup instantly. No waiting, simply signup and login.
Signup Now!

Reseller Accounts!
We offer completely Branded Windows 2000 Reseller Accounts to fit any budget and any size.
More details

Email using CDONTS
Using Locale Id

We are a member of
ASP Webring Webring Homepage Previous Site in the Ring Next Site in the Ring