[fpc-pascal] DateToStr locale

Michael Van Canneyt michael at freepascal.org
Wed Nov 1 20:53:12 CET 2006



On Wed, 1 Nov 2006, Henry Vermaak wrote:

> hello all
>
> i've noticed that DateToStr gives correct results on win32 (regarding
> locale), but on linux and osx it always gives the date as dd-mm-yyyy.
> i read somewhere in the archives that there's a problem implementing
> this due to the need to link to libc or something (hand wavy).  can
> anyone shed some light on this for me, or does anyone know about a
> work around?

The locale info on Linux is stored in some files somewhere in /usr/lib/*
The routines to access these files are in Libc. Since SysUtils should remain
free from dependencies on the C library, we cannot use it to initialize the
constants...

I have somewhere a unit that links to C or uses the KDE info to initialize
the localization constants in SysUtils. If you don't mind linking to C then
I can send you this.

If you want to make a Pascal version of the localization routines, then
Please do :-)

Michael.



More information about the fpc-pascal mailing list