This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: printing wchar_t*


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.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]