[fpc-devel] Locale solution for Linux (and maybe *nix)
Michael Van Canneyt
michael at freepascal.org
Mon Aug 4 09:38:44 CEST 2008
On Mon, 4 Aug 2008, Graeme Geldenhuys wrote:
> In FPC the locale information is all hard-coded for Linux and other
> Unix based systems. We don't all live in the USA. ;-) This is very
> annoying. I also know we may not use glibc calls in FPC to get the
> locale information, because glibc is not always available on systems
> other than Linux.
> Today I found the following on my Linux system which could possibly
> solve this issues. Could other Linux distros and Unix users (*BSD,
> etc) confirm if they also have the following directory?
> Under Ubuntu 7.10 I have the follow directory: /usr/share/i18n/locales/
> Inside that directory are files like en_GB, en_US, es_ES, de_DE etc....
> They are plain text files that should be fairly easy to parse and
> extract the locale information. Couldn't we use that to populate the
> locale information inside FPC, without the need of glibc?
I am aware of this, there should also be a symbolink link in /etc to
one of these files. The reason I didn't use this info is because writing
a parser for these files is not trivial.
So, if you can write a parser for these files, please do, and I'll integrate
it at once in the sysutils unit :-)
More information about the fpc-devel