[fpc-devel] Locale solution for Linux (and maybe *nix)

Marco van de Voort marcov at stack.nl
Mon Aug 4 10:13:08 CEST 2008


[ Charset UTF-8 unsupported, converting... ]
> On Mon, Aug 4, 2008 at 9:38 AM,  <petr.kristan at epos.cz> wrote:
> >>
> > Include rtl/unix/clocale.pp into your project.
> 
> Thanks Petr, but that requires libc, hence the reason it can't be
> added to the sysutils unit. That was my understanding of the locale
> issue, based an a message I posted some months ago. Also, those libc
> API calls read the binary form of the locale files if I remember
> correctly.

But it fills the locale records of the sysutils unit if you include it in your
mainprogram. IOW it just works like thread support. (cthreads), where a libc
driver updates system/classes (the threaddriver). clocale does the same for
sysutils' locale.

> What I am suggesting, is reading the plain text locale files and parse
> them ourselves without the need for Libc dependency.

It will add a lot of code to all programs, and make you dependant on
the formats changing. Maybe it would be more clear if you explained what the
problem with the clocale solution exactly is.

> I just need to confirm what other Linux and Unix OS's have those files
> available?

FreeBSD seems to have different ones. Some are text, but just lists of
strings without any annotation (iow different from yours). Some are binary.

Location /usr/share/locale/nl_NL.<codepage>   The utf-8 ones are symlinks to
the ISO8859-1 ones.

LC_COLLATE        binary
LC_MESSAGES       Something that looks like two regexes on separate lines.
LC_NUMERIC        6 byte file. Probably a kind of record, but a field per line. 
LC_CTYPE          binary      
LC_MONETARY       Same build-up as LC_NUMERIC, but larger. 
LC_TIME           Same again, but even larger.




More information about the fpc-devel mailing list