[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xfree-i18n
Subject:    Re: [I18n]Locales and charset encodings
From:       Markus Kuhn <Markus.Kuhn () cl ! cam ! ac ! uk>
Date:       2002-11-12 18:29:45
[Download RAW message or body]

Juliusz Chroboczek wrote on 2002-11-12 16:49 UTC:
> Use nl_langinfo(3), but it's an SUSv2 interface (i.e. it's not in POSIX)

POSIX.{1,2}:2001 and SUSv4 are the same thing now.

So nl_langinfo(CODESET) is now actually officially part of the holy
dogma of the church of POSIX. Halleluhia.

Unfortunately, the return values of nl_langinfo(CODESET) are not
standardized. Fortunately, the systems out there that implement
nl_langinfo(CODESET) can be counted with the fingers of one hand
and their outputs are easily normalized by a little routine:

  http://www.cl.cam.ac.uk/~mgk25/ucs/norm_charmap.c

On legacy systems without nl_langinfo(CODESET), you can get a decent
educated guess from this routine:

  http://www.cl.cam.ac.uk/~mgk25/ucs/langinfo.c

More on this issue is on:

  http://www.cl.cam.ac.uk/~mgk25/unicode.html#activate

DW> Would there be a way to _force_ the encoding to, say UTF-8?

Unfortunately not with any formally standardized functions. The inertia
of standardization bodies makes it currently not feasible to give up the
notion that UTF-8 is a bit more useful than yet-another
multibyte-encoding. Until then, XFree86 has added Xutf8*() functions for
that exact purpose, and we strongly hope that they will catch on with
other implementors as well. Though not all have seen the light yet.

Don't expect any progress with the X11 spec soon. What was supposed to
be the X11 standards body (X.Org) has been in a coma for several years
and is awaiting its death certificate.

Markus

-- 
Markus G. Kuhn, Computer Laboratory, University of Cambridge, UK
Email: mkuhn at acm.org,  WWW: <http://www.cl.cam.ac.uk/~mgk25/>

_______________________________________________
I18n mailing list
I18n@XFree86.Org
http://XFree86.Org/mailman/listinfo/i18n
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic