IIS 6.0 local LCID problem

Discussion in 'ASP General' started by Just4U, Aug 28, 2007.

  1. Just4U

    Just4U Guest

    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
     
    Just4U, Aug 28, 2007
    #1
    1. Advertising

  2. Just4U

    Evertjan. Guest

    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)
     
    Evertjan., Aug 28, 2007
    #2
    1. Advertising

  3. Just4U

    Just4U Guest

    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.
    >
    >
     
    Just4U, Aug 28, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Clive
    Replies:
    1
    Views:
    664
    John Saunders
    Aug 28, 2003
  2. ubi_comp
    Replies:
    0
    Views:
    2,267
    ubi_comp
    Feb 3, 2006
  3. Thomas Troeger
    Replies:
    2
    Views:
    740
    Tim Golden
    Sep 22, 2008
  4. George Hester

    LCID Problem.

    George Hester, Jul 29, 2003, in forum: ASP General
    Replies:
    1
    Views:
    102
    George Hester
    Jul 30, 2003
  5. b_boy

    Session.LCID problem

    b_boy, Oct 16, 2003, in forum: ASP General
    Replies:
    5
    Views:
    170
    b_boy
    Oct 17, 2003
Loading...

Share This Page