[Haskell-i18n] Unicode in source
Glynn Clements
glynn.clements@virgin.net
Thu, 22 Aug 2002 19:52:55 +0100
Alastair Reid wrote:
> >> The other interpretation is that all glyphs have widths which are
> >> an integral number of "columns". Western (latin, cyrillic, Greek)
> >> characters are a single column wide, while CJK characters are
> >> typically two columns wide. The (Unix98) wcwidth() function can be
> >> used to obtain the width (in columns) of a given wide character
> >> (wchar_t) in the current locale.
>
> >> The (Unix98) wcwidth() function can be used to obtain the width (in
> >> columns) of a given wide character (wchar_t) in the current locale.
> ^^^^^^^^^^^^^^^^^^^^^
> Can you clarify whether this is because the mapping of wchar_ts onto
> Unicode code points depends on the locale or whether the width of a
> Unicode code point depends on the locale.
It's basically the former, although Unicode doesn't come into it
directly. The locale (specifically, the LC_CTYPE category) determines
the character encoding, and hence the "meaning" of any given wchar_t
(or char) value.
--
Glynn Clements <glynn.clements@virgin.net>