[fpc-pascal] locale solution for unix systems

Marco van de Voort marcov at stack.nl
Fri Mar 20 12:06:14 CET 2009


In our previous episode, Henry Vermaak said:
> > Because the textmode versions might not be installed on all systems, the
> > compiled versions might be OS specific, and if they ever change for linux
> > distributions you have another problem at your hand.
> >
> > And IMHO it is not crucial enough to try to bypass libc.
> 
> i agree.  my opinion has always been that since it's a libc invention
> in the first place , libc will always be available on systems with
> this locale information, so it's a lot easier just linking to libc and
> using nl_langinfo to set up the global variables in fpc.

That's what clocale already does. Note that the way how this happens is not
straight forward, since the exact interpretation of what libc returns and
which fields are filled differ. See clocale.

So please start with inventorizing what clocale doesn't do, and see if this
can be amended some other way before embarking on great adventures into the
unknown, because those are never _that_ simple. Specially when done
multiplatform and then maintained over time (hence: multiversion).



More information about the fpc-pascal mailing list