Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > IIS 6.0 local LCID problem

Reply
Thread Tools

IIS 6.0 local LCID problem

 
 
Just4U
Guest
Posts: n/a
 
      08-28-2007
Hello,

I take an old post because, nobody seem to answer my problem.

Config: Windows 2003 x64 (US) + sp2
Regional settings : French (for all & default users)

Basically I have the following code on my server


<%
Session.LCID=1033
SetLocale(1033)
Response.Write "<u>America</u><br>"
Response.Write FormatDateTime(now,vbshortDate)&"<br>"
Response.Write FormatNumber(1000.523)&"<br>"
Session.LCID=2057
SetLocale(2057)
Response.wRIte "<u>UK</u><br>"
Response.Write FormatDateTime(now,vbshortDate)&"<br>"
Response.Write FormatNumber(1000.523)&"<br>"
Session.LCID=1036
SetLocale(1036)
Response.wRIte "<u>French</u><br>"
Response.Write FormatDateTime(now,vbshortDate)&"<br>"
Response.Write FormatNumber(1000.523)&"<br>"
Session.LCID=1031
SetLocale(1031)
Response.wRIte "<u>German</u><br>"
Response.Write FormatDateTime(now,vbshortDate)&"<br>"
Response.Write FormatNumber(1000.523)&"<br>"

%>


very simple, all it does is set the session.LCID to four different
locales (US,UK,French, German) when no one if physically logged on to
the webserver in question, it writes out the data/number
format for US in UK format (the machine locale) however it does French
and German in the correct format. If someone is logged on to the machine
it starts to show the US format in the correct format.

So does anyone know why this is happening and if so any solution to the
problem?


Thank you
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      08-28-2007
Just4U wrote on 28 aug 2007 in microsoft.public.inetserver.asp.general:

> Hello,
>
> I take an old post because, nobody seem to answer my problem.
>
> Config: Windows 2003 x64 (US) + sp2
> Regional settings : French (for all & default users)
>
> Basically I have the following code on my server
>
>
> <%
> Session.LCID=1033
> SetLocale(1033)
> Response.Write "<u>America</u><br>"
> Response.Write FormatDateTime(now,vbshortDate)&"<br>"
> Response.Write FormatNumber(1000.523)&"<br>"
> Session.LCID=2057
> SetLocale(2057)
> Response.wRIte "<u>UK</u><br>"
> Response.Write FormatDateTime(now,vbshortDate)&"<br>"
> Response.Write FormatNumber(1000.523)&"<br>"
> Session.LCID=1036
> SetLocale(1036)
> Response.wRIte "<u>French</u><br>"
> Response.Write FormatDateTime(now,vbshortDate)&"<br>"
> Response.Write FormatNumber(1000.523)&"<br>"
> Session.LCID=1031
> SetLocale(1031)
> Response.wRIte "<u>German</u><br>"
> Response.Write FormatDateTime(now,vbshortDate)&"<br>"
> Response.Write FormatNumber(1000.523)&"<br>"
>
> %>
>
>
> very simple, all it does is set the session.LCID to four different
> locales (US,UK,French, German) when no one if physically logged on to
> the webserver in question, it writes out the data/number
> format for US in UK format (the machine locale) however it does French
> and German in the correct format. If someone is logged on to the
> machine it starts to show the US format in the correct format.
>
> So does anyone know why this is happening and if so any solution to
> the problem?


I do not think you can or should change the locale after a
response.write.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
 
Just4U
Guest
Posts: n/a
 
      08-28-2007
Hello,

yes i can because it's work for other LCID except for 1033 !!
Here is my test code:

I did a simple test:
<%
ReturnDateTime 1033, "English (US)"
ReturnDateTime 1036, "French"
ReturnDateTime 3081, "English (Australia)"

Sub ReturnDateTime(locale, description)
Session.LCID = locale
Response.Write "<b>" & description & " (LCID = " & locale &
")</b><br>"
Response.Write "Long date: " & FormatDateTime(Date, 1) & "<br>"
Response.Write "Short date: " & FormatDateTime(Date, 2) & "<br>"
Response.Write "<p>" & FormatCurrency(1.05, 2) & "<br>"
Response.Write "<br>" & FormatNumber(1000000,2) & "<br></p>"
End Sub

%>

Results:

English (US) (LCID = 1033)
Long date: Monday 27 August 2007
Short date: 27/08/2007
1,05 €
1 000 000,00

French (LCID = 1036)
Long date: lundi 27 août 2007
Short date: 27/08/2007
1,05 €
1 000 000,00

English (Australia) (LCID = 3081)
Long date: Monday, 27 August 2007
Short date: 27/08/2007
$1.05
1,000,000.00



Evertjan. wrote:
> Just4U wrote on 28 aug 2007 in microsoft.public.inetserver.asp.general:
>
>
>>Hello,
>>
>>I take an old post because, nobody seem to answer my problem.
>>
>>Config: Windows 2003 x64 (US) + sp2
>>Regional settings : French (for all & default users)
>>
>>Basically I have the following code on my server
>>
>>
>><%
>>Session.LCID=1033
>>SetLocale(1033)
>>Response.Write "<u>America</u><br>"
>>Response.Write FormatDateTime(now,vbshortDate)&"<br>"
>>Response.Write FormatNumber(1000.523)&"<br>"
>>Session.LCID=2057
>>SetLocale(2057)
>>Response.wRIte "<u>UK</u><br>"
>>Response.Write FormatDateTime(now,vbshortDate)&"<br>"
>>Response.Write FormatNumber(1000.523)&"<br>"
>>Session.LCID=1036
>>SetLocale(1036)
>>Response.wRIte "<u>French</u><br>"
>>Response.Write FormatDateTime(now,vbshortDate)&"<br>"
>>Response.Write FormatNumber(1000.523)&"<br>"
>>Session.LCID=1031
>>SetLocale(1031)
>>Response.wRIte "<u>German</u><br>"
>>Response.Write FormatDateTime(now,vbshortDate)&"<br>"
>>Response.Write FormatNumber(1000.523)&"<br>"
>>
>>%>
>>
>>
>>very simple, all it does is set the session.LCID to four different
>>locales (US,UK,French, German) when no one if physically logged on to
>>the webserver in question, it writes out the data/number
>>format for US in UK format (the machine locale) however it does French
>>and German in the correct format. If someone is logged on to the
>>machine it starts to show the US format in the correct format.
>>
>>So does anyone know why this is happening and if so any solution to
>>the problem?

>
>
> I do not think you can or should change the locale after a
> response.write.
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
session.lcid not kept across pages in asp.net ubi_comp ASP .Net 0 02-03-2006 01:52 PM
Session.LCID problem b_boy ASP General 5 10-17-2003 10:35 PM
Session.lcid has stopped working Bibble Babble Computer Support 1 10-11-2003 09:47 AM
CultureInfo/LCID on Client Machine Clive ASP .Net 1 08-28-2003 04:33 PM
LCID Problem. George Hester ASP General 1 07-30-2003 12:37 AM



Advertisments