Followup to: <[EMAIL PROTECTED]>
By author: =?iso-8859-1?Q?Keld_J=F8rn_Simonsen?= <[EMAIL PROTECTED]>
In newsgroup: linux.utf8
>
> On Sat, Jun 02, 2001 at 02:28:35PM -0700, H. Peter Anvin wrote:
> > Followup to: <[EMAIL PROTECTED]>
> > By author: "Michael B. Allen" <[EMAIL PROTECTED]>
> > In newsgroup: linux.utf8
> > >
> > > > > Why doesn't wchar_t play nice with Unicode?
> > > >
> > > > It does, if your C implementation defines the macro name
> > > > __STDC_ISO_10646__ (see the C standard for additional information).
> > >
> > > No. It doesn't regardless of how the C99 macro is set. AFAICT you cannot
> > > convert from wchar_t to an arbitrary encoding without going through a
> > > 7 or 8 bit locale dependant encoding such as UTF-8 or IS0-8859-1. For
> > > example, if I have a lot of UCS-2 code and want to use wchar_t functions
> > > like wprintf I must first convert the string to UTF-8 using iconv and
> > > then again to wchar_t * with mbstowcs.
>
> I would advise you against using UCS-2, as it is only a partial
> solution. Use UCS-4 instead. It has recently been approved in ISO
> to add characters in ISO 10646 beyond the 64 k.
>
Indeed, and if you're receiving UCS-2 characters from the outside, you
probably want to consider it to be UTF-16 instead, as it is likely to
become that at some point. (Standard flame about UTF-16 deleted.)
-hpa
--
<[EMAIL PROTECTED]> at work, <[EMAIL PROTECTED]> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt
-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/linux-utf8/