wcwidth and locale files?
Bruno Haible
haible@ilog.fr
Mon Jul 17 10:46:00 GMT 2000
Hi Ulrich,
As I see it, the character width information for wcwidth must be
specified in the character set file (ISO-8859-1, UTF-8 etc). I would
prefer to have it in the locale files for the following reasons:
1) Even in a ISO-8859-1 locale, it is useful to know that chinese
ideographs have width 2. Programs working entirely on wchar_t*
strings and never converting them to char* strings should not
get wrong information just because the character is not
convertible to char*.
2) We would have to add this width information to charmaps/UTF-8
and charmaps/SJIS etc.
But the width information is closely related to the iswprint
function, which is defined in the locale files.
3) The locale files have a 'copy' directive, which the charmaps
don't have. Thus avoiding table duplication.
4) You once said (in linux-utf8 on 2000-02-08) that
"I have a correct implementation in glibc. It is not based on
some obscure hardcoded algororithm but instead allows locale-
dependent information."
Can you extend the locale input file format so the width information
can be given there?
Bruno
More information about the Libc-alpha
mailing list