0

I have set the correct region for Windows via the control panel and rebooted the machine.

I have also set ASP.net's Culture setting in IIS, although I'm not sure if this has any effect on ASP Classic.

Yet formatDateTime and formatCurrency are still outputting US formatting instead of UK formatting.

Where else is this set?

Ian Warburton
  • 15,170
  • 23
  • 107
  • 189

1 Answers1

3

in classic ASP you need to set the LCID variable to the locale code of your preference

a good way to place such setting is in the Session_OnStart call

Sub Session_OnStart

  Session.LCID = 2057 ' 2057 is for English UK

End Sub

You can see all available codes on Microsoft page

balexandre
  • 73,608
  • 45
  • 233
  • 342
  • Why would I need to set this on a new installation of an app, and not on the old? – Ian Warburton Dec 09 '15 at 18:49
  • I've done what you suggested and now the currency is coming out as, "£". – Ian Warburton Dec 09 '15 at 18:51
  • #balenxandre is right, I just don't know why he is using **sub session_onstart** anyway take a look at [LCID on w3schools](http://www.w3schools.com/asp/prop_lcid.asp) hope this help! – Vixed Dec 09 '15 at 18:51
  • @Ian about the "£" you should fix your encoding, try with utf8 [Classic ASP and utf8](http://stackoverflow.com/questions/1453864/classic-asp-and-utf-8) – Vixed Dec 09 '15 at 18:54
  • Try `Session.codepage = 65001` to get your £ symbol to display correctly. it should go underneath your Session.LCID definition – John Dec 09 '15 at 18:54
  • Why would elsewhere in the app, the currency be correct? – Ian Warburton Dec 09 '15 at 18:55
  • @Vixed I always use server events: http://www.w3schools.com/asp/ev_sess_onend_onstart.asp – balexandre Dec 09 '15 at 18:56
  • @balexandre ok, but for me, and I mean only for my idea, it seems to be an old old way to use classic asp. – Vixed Dec 09 '15 at 18:58
  • @balexandre - Presumably your subroutine is supposed to go in global.asa - if so it might be worth saying so explicitly. – John Dec 09 '15 at 19:05