My Delphi7 program is in a non-English language and uses some Win1250 ANSI characters extensively. (aáíóőű)
I have noticed that under English language Windows XP/Vista/7 systems many accented characters appear non-accented (ie.: o instead of ő, u instead of ű) in Form and Label Captions.
On localized Windows XP/Vista systems there are no problems. But on some Windows 7 systems (maybe only on 64bit versions, I'm not sure) even if the Windows instance is localized, accented characters aren't displayed normally.
What I've also noticed is that on these systems DateToStr will output 11/17/2010 instead of 2010.11.17 - which is the standard localized format. The funny thing is that I've checked it under the regional settings, and the default date format is set to yyyy.mm.dd - why is DateToStr giving me back dd/mm/yyyy instead?
I've noticed the same behaviour with currencies ("," appearing as the decimal separator instead of ".", etc.).
Any ideas?
Thanks!
I have noticed that under English language Windows XP/Vista/7 systems many accented characters appear non-accented (ie.: o instead of ő, u instead of ű) in Form and Label Captions.
Delphi 7 applications are non-unicode (except if you use components like TNT Components), so you need to check active CodePage for non-Unicode applications in Windows. In Win7, go to Control Panel | Region and Language | Administrative | Change system locale, and change the default ANSI CodePage for Windows.
What I've also noticed is that on these systems DateToStr will output 11/17/2010 instead of 2010.11.17 - which is the standard localized format. The funny thing is that I've checked it under the regional settings, and the default date format is set to yyyy.mm.dd - why is DateToStr giving me back dd/mm/yyyy instead?
This seems to be same as the below report: http://social.technet.microsoft.com/Forums/en-US/w7itprogeneral/thread/b4f90f07-206c-494b-8d14-ee17bfa689e0
It seems to be a bug in Windows. I had the same problem in one of my projects written for a Slovenian customer. I told the customer to set change current Date/Time settings to something different, save the changes, then go back to Date/Time settings, and change it back to his desired format. That would fix the problem.
Also in the link above, a programming workaround is mentioned:
From S.B.Christensen:
Hi Tim
I just had the same issu as you (also doing Delphi development).
If you wish to avoid your users to do the workaround themselves, use the following unit as the first in your project:
unit Win7;
interface
uses SysUtils, Windows;
implementation
initialization SetThreadLocale(LOCALE_USER_DEFAULT); GetFormatSettings; end.
I haven't tested the code myself, cuz the previous workaround worked fine for me.