Unicode support of VC++ runtime
From: Arno Schoedl (aschoedl_at_think-cell.com)
Date: 06/08/04
- Next message: William DePalo [MVP VC++]: "Re: Creating API"
- Previous message: June: "Re: multiple mice problem"
- Next in thread: Tim Roberts: "Re: Unicode support of VC++ runtime"
- Reply: Tim Roberts: "Re: Unicode support of VC++ runtime"
- Messages sorted by: [ date ] [ thread ]
Date: 8 Jun 2004 09:38:03 -0700
Hello,
I am having trouble with Unicode support of wide character functions
in the runtime library. With default C locale, wcsftime does not
support certain Unicode characters (for example, per mille) because it
converts the format string to 8 bit for doing its work, and this
conversion is not reversible with the default code page. Why do 16-bit
functions depend on the 8 bit code page setting?
Anyway, when switching to UTF-8 MBCS using setlocale( LC_ALL,
"English_USA.65001" ) and _setmbcp( CP_UTF8 ) to enable 8 <-> 16-bit
round-tripping, many other runtime functions (e.g., swprintf) stop
working because they internally use mbtowc. Visual C++'s mbtowc
expects DBCS, or MBCS with no more than 2 bytes per character. UTF-8
has up to four per character:-(
What am I doing wrong? How do I get full Unicode (or at least UCS-16,
first 65536 characters of Unicode) support from the VC++ runtime
library?
Arno
- Next message: William DePalo [MVP VC++]: "Re: Creating API"
- Previous message: June: "Re: multiple mice problem"
- Next in thread: Tim Roberts: "Re: Unicode support of VC++ runtime"
- Reply: Tim Roberts: "Re: Unicode support of VC++ runtime"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|