Setting the Locale Identifier

A locale is a set of user preference information related to the user's language. The locale determines how dates and times are formatted, how items are alphabetically sorted, and how strings are compared. The locale identifier (LCID) is a 32-bit value that uniquely defines a locale. ASP uses the default locale of the Web server unless you specify a different locale for a particular script.

To set the locale identifier for an ASP page, use the @ LCID directive. For example, to set the locale to Japanese, use the following locale identifier:

<%@ LCID = 1041 %>
 

The @ LCID directive tells ASP the locale in which the script was authored. If you need to change the locale for input to or output from the script, use the Session.LCID property.

The following example demonstrates setting the locale to British English, and using the VBScript FormatCurrency method to display the value 125 as currency with the £ symbol:

<% 
  Session.LCID = 2057
  Dim curNumb
  curNumb = FormatCurrency(125)
  Response.Write (curNumb)
%>

The Session.LCID property defaults to the @ LCID directive setting. Setting the value of Session.LCID in a script overrides the default setting.

For more information on LCIDs see "International Features" in the "Windows Base Services" section.