Re: [dev] [st] wide characters

From: Aurélien Aptel <aurelien.aptel_AT_gmail.com>
Date: Sun, 14 Apr 2013 01:07:57 +0200

On Sat, Apr 13, 2013 at 11:17 PM, Random832 <random832_AT_fastmail.us> wrote:
> I am forced to ask, though, why character cell values are stored in utf-8
> rather than as wchar_t (or as an explicitly unicode int) in the first place,
> particularly since the simplest way to detect a wide character is to call
> the function wcwidth. What was the reason for this design decision? It
> doesn't save any space, since on most systems UTF_SIZ == sizeof(int) ==
> sizeof(wchar_t).

The ISO/IEC 10646:2003 Unicode standard 4.0 says that:

    "The width of wchar_t is compiler-specific and can be as small as
8 bits. Consequently, programs that need to be portable across any C
or C++ compiler should not use wchar_t for storing Unicode text. The
wchar_t type is intended for storing compiler-defined wide characters,
which may be Unicode characters in some compilers."

utf-8 is rather straightforward to handle and process.
Received on Sun Apr 14 2013 - 01:07:57 CEST

This archive was generated by hypermail 2.3.0 : Sun Apr 14 2013 - 01:12:05 CEST