This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

wcwidth and locale files?



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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]