Re: printing wchar_t*

Robert Dewar
2006-04-14T13:38:31Z

Daniel Jacobowitz wrote:
> On Fri, Apr 14, 2006 at 03:55:49PM +0300, Eli Zaretskii wrote:
>> Anyway, UTF-16 is a variable-length encoding, so wchar_t is not it.
>
> There's a rant about this in the glibc manual I was just reading...
>
> In fact, on many platforms, wchar_t is only 16-bit. How exactly you
> handle UTF-8 or UCS-4 input in this case, I don't really understand.

Seems clear, you can only represent a limited range of codes if you
only have 16 bits!

UTF-8 is a variable length encoding that can represent any character
in the 32-bit range. Obviously if you have to construct wchar_t
values from UTF-8 input, then you will not be able to represent
characters whose codes exceed 65535. Same with UCS-4.
>