On 02/20/2012 07:42 PM, Chet Ramey wrote: > On 2/18/12 5:39 AM, John Kearney wrote: > >> Bash Version: 4.2 >> Patch Level: 10 >> Release Status: release >> >> Description: >> Current u32toutf8 only encode values below 0xffff correctly. >> wchar_t can be ambiguous size better in my opinion to use >> unsigned long, or uint32_t, or something clearer. > > Thanks for the patch. It's good to have a complete implementation, > though as a practical matter you won't see UTF-8 characters longer > than four bytes. I agree with you about the unsigned 32-bit int > type; wchar_t is signed, even if it's 32 bits, on several systems > I use.
Not only can wchar_t can be either signed or unsigned, you also have to worry about platforms where it is only 16 bits, such as cygwin; on the other hand, wint_t is always 32 bits, but you still have the issue that it can be either signed or unsigned. -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature