2025-04-27 07:49:33 -04:00

110 lines
5.5 KiB
HTML
Raw Blame History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<TITLE>LCID</TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
TempString = navigator.appVersion
if (navigator.appName == "Microsoft Internet Explorer"){
// Check to see if browser is Microsoft
if (TempString.indexOf ("4.") >= 0){
// Check to see if it is IE 4
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
}
else {
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
}
}
else if (navigator.appName == "Netscape") {
// Check to see if browser is Netscape
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/coua.css">');
}
else
document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/cocss.css">');
//-->
</script>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub Window_OnLoad()
Dim frmContents
On Error Resume Next
If Not Parent Is Nothing Then
Set frmContents = Parent.Contents
If Not frmContents Is Nothing Then
frmContents.Window.TOCSynch_Click
End If
End If
End Sub
//--></SCRIPT><META NAME="DESCRIPTION" CONTENT="Internet Information Services reference information">
<META HTTP-EQUIV="PICS-Label" CONTENT='(PICS-1.1 "<http://www.rsac.org/ratingsv01.html>" l comment "RSACi North America Server" by "inet@microsoft.com <mailto:inet@microsoft.com>" r (n 0 s 0 v 0 l 0))'>
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="MS-IT-LOC" Content="Internet Information Services">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H4><A NAME="_lcid"></A><SUP></SUP>LCID</H4>
<P>The <B>LCID</B> property specifies how dates, times, and currencies are formatted. LCIDs are not the same for each geographical locale. Some locales format dates as YY-MM-DD and some format dates as MM-DD-YYYY. The <B>LCID</B> property is read/write.</P>
<H6>Syntax</H6>
<P><B>Session.LCID</B>(= <I>LocaleID</I>)</P>
<P>&nbsp;</P>
<H6>Parameters</H6>
<DL>
<DT><I>LocaleID</I></DT>
<DD>An integer that represents the geographical locale. You can find locale integers at <a href="http://www.microsoft.com/isapi/redir.dll?prd=msdn&sbp=library&pver=6.0&ar=appendix&sba=locale" target=_blank><b>MSDN Library</b></a>.</DD>
</DL>
<H6>Remarks</H6>
<P>Setting Session.LCID explicitly affects all responses in a session. </P>
<P>If Session.LCID is not explicitly set in a page, it is implicitly set by the AspLCID metabase property. If the AspLCID metabase property is not set, or set to 0, Session.LCID is set by the default system locale. </P>
<P>Session.LCID can be set multiple times in one Web page and used to format data each time. Some locales need the matching codepage to be set to display characters properly. For example, to display dates and times in several locales on one page, the codepage must be set to UTF-8 (65001) to show all the characters.</P>
<P>If you set Response.LCID or Session.LCID explicitly, do so before displaying formatted output. Setting Session.LCID changes the locale for both the ASP application and the scripting engine.&nbsp; Using the VBScript function <B>setLocale()</B> only changes the locale for the scripting engine.</P>
<P>If the locale of your Web page matches the system defaults of the Web client, you do not need to set a locale in your Web page. However, setting the value is recommended.</P>
<P>If the locale is set in a page, and the codepage is set to display the characters properly, then <B>Response.Charset</B> should also be set. The codepage value tells IIS how to encode the data when building the response, and the charset value tells the browser how to decode the data when displaying the response. The <I>CharsetName</I> of Response.Charset must match the codepage value, or mixed characters are displayed in the browser. Lists of <I>CharsetNames</I> and matching codepage values can be found at <a href="http://www.microsoft.com/isapi/redir.dll?prd=msdn&sbp=workshop&pver=6.0&ar=reference&sba=charsets " target=_blank><b>MSDN Web Workshop</b></a> under the columns for Preferred Charset Label and FamilyCodePage.</P>
<P>If you are writing and testing Web pages that use different locales, codepages, and character sets (for example, creating a multi-lingual Web site), remember that your test client computer must have the language packs installed for each language you wish to display. You can install language packs from Regional Options in the Control Panel.</P>
<H6>Example</H6>
<P>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 <20> symbol:</P>
<P><CODE>&lt;% </CODE></P>
<P><CODE>&nbsp;&nbsp;Session.LCID = 2057</CODE></P>
<P><CODE>&nbsp;&nbsp;Dim curNumb</CODE></P>
<P><CODE>&nbsp;&nbsp;curNumb = FormatCurrency(125)</CODE></P>
<P><CODE>&nbsp;&nbsp;Response.Write (curNumb)</CODE></P>
<P><CODE>%&gt;</CODE></P>
<PRE></PRE>
<H6>Applies To</H6>
<P><A HREF="/iishelp/iis/htm/asp/vbob12d0.htm"><B>Session</B> Object</A> </P>
<H6>See Also</H6>
<P><A HREF="/iishelp/iis/htm/asp/vbob7fw4.htm"><B>Charset</B></A>, <A HREF="/iishelp/iis/htm/asp/vbob150l.htm"><B>CodePage</B></A>, <A HREF="eadg4o37.htm">Accommodating International Clients</A>.</P>
<hr class="iis" size="1">
<p align="center"><em><a href="../../../common/colegal.htm">&copy; 1997-2001 Microsoft Corporation. All rights reserved.</a></em></p>
</BODY>
</HTML>