[fpc-devel] Setting locale format data

Derek Edson mr.ed.123 at gmail.com
Fri Apr 11 02:08:26 CEST 2014


I have an application that reads a locale from a configuration file (simple
form).  This determines how the output is formatted, in particular
date-time.  This change is local to the application and does not effect the
rest of the computer.

This was originally written in Delphi which provides GetFormatSettings
which is callable after changing the locale.  There is also a routine
GetLocaleFormatSettings is neccessary.

Moving this application to FPC, I can still get GetFormatSettings on
Windows.

The issue is moving this to another platform, in particularly Linux.

I have a routine to deal with the locale namings on the different
platforms, which works nicely.  I can change the thread locale. The issue
is that GetFormatSettings is not available.

I have made a local patch to export the equivalent function under linux.  I
simply turned the initialization code into a routine and exported this with
the same name.

Can this routine be made available on other/all platforms, or is there a
better way to do it?


-- 
Derek Edson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20140411/78227312/attachment.html>


More information about the fpc-devel mailing list