IIS 6.0 local LCID problem

J

Just4U

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
 
E

Evertjan.

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

Just4U

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top