Unicode support of VC++ runtime

From: Arno Schoedl (aschoedl_at_think-cell.com)
Date: 06/08/04


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



Relevant Pages

  • Unicode text editor mined 2000 release 11
    ... are not aware of (like auto-detection features and automatic handling ... It was the first editor that supported Unicode in a plain-text terminal. ... Combining character width properties. ... Added keyboard configuration examples for Control-function key detection for rxvt and mlterm to the runtime support library. ...
    (comp.editors)
  • Unicode text editor mined 2000 release 11
    ... Mined provides both extensive Unicode and CJK support offering many ... of terminal variations, or Han character information). ... It was the first editor that supported Unicode in a plain-text terminal. ...
    (comp.os.linux.announce)
  • Re: CLisp case sensitivity
    ... it explicitly allows conforming lisps not to support ... Lisp implementation _also_ conforming with Unicode. ... >> character with a Basic Multilingual Plane character ...
    (comp.lang.lisp)
  • Re: Upcoming release and unicode
    ... > Macintosh into a Unicode-throughout suite of applications. ... > As noted below, Office 2004 for Macintosh will support the input, display, ... > and basic editing of Unicode characters associated with the following ... > compatibility and character fidelity with Office for Windows. ...
    (microsoft.public.mac.office.word)
  • mined: Unicode text editor back for minix?
    ... Mined provides both extensive Unicode and CJK support offering many ... specific features and covering special cases that other editors ... of terminal variations, or Han character information). ... Versatile character encoding support ...
    (comp.os.minix)