This is the mail archive of the
glibc-linux@ricardo.ecn.wfu.edu
mailing list for the glibc project.
Re: charset for a locale
- To: glibc-linux at ricardo dot ecn dot wfu dot edu
- Subject: Re: charset for a locale
- From: Andreas Jaeger <aj at suse dot de>
- Date: 25 Feb 2001 17:28:59 +0100
- References: <20010225105958.A8493@pimlott.ne.mediaone.net>
- Reply-To: glibc-linux at ricardo dot ecn dot wfu dot edu
andrew@pimlott.ne.mediaone.net (Andrew Pimlott) writes:
> I hope this is an ok place to ask this question.
>
> I have read the glibc 2.2 documentation on charset handling and
> locales, and a very basic concept still escapes me. How can I
> figure out the default multibyte encoding for the current locale
> (ie, the encoding used to interpret the char type)? It seems that I
> can use the mbtowc functions to convert any string to Unicode (well,
> this assumes I know the wchar encoding, but in practice this is
> easier), but can't actually query the multibyte encoding used by
> mbtowc. This would seem further to imply that mbtowc has
> functionality that cannot be obtained with the iconv functions,
> which I find strange.
>
> Did I miss something? Is there a reason that most people don't need
> this functionality?
#include <langinfo.h>
...
prinf ("%s\n", nl_langinfo(CODESET));
...
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj