Subject: Default rune widths for 8-bit characters
To: NetBSD tech-userlevel mailing list <tech-userlevel@netbsd.org>
From: Julian Coleman <jdc@coris.org.uk>
List: tech-userlevel
Date: 10/08/2007 11:18:17
Hi,
I was looking at PR 36560, where characters in the range 0x80 to 0xff are
not displayed by sysinst (libcurses). This is because libcurses now calls
wcwidth() for each character added to the screen. In the case of sysinst,
LC_CTYPE is not set and we are using static linking. Because there are no
definitions for the width of characters 0x80 to 0xff in _DefaultRuneLocale
in src/lib/libc/locale/runetable.c, wcwidth() returns 0 and libcurses does
not display the characters.
A fix seems to be to add _CTYPE_SW1, for the additional characters (as per
appended patch), but I was wondering why these characters do not already
have width information.
Thanks,
J
- - 8< - - - - - - - - - - - - - Cut here - - - - - - - - - - - - - >8 - -
--- src/lib/libc/locale/runetable.c.dist 2005-12-03 17:01:31.000000000 +0000
+++ src/lib/libc/locale/runetable.c 2007-10-06 23:05:15.000000000 +0100
@@ -187,6 +187,134 @@
_CTYPE_P|_CTYPE_R|_CTYPE_G|_CTYPE_SW1,
_CTYPE_P|_CTYPE_R|_CTYPE_G|_CTYPE_SW1,
_CTYPE_C,
+ /*80*/ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _C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PE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
+ _CTYPE_SW1,
},
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
- - 8< - - - - - - - - - - - - - Cut here - - - - - - - - - - - - - >8 - -
--
My other computer also runs NetBSD / Sailing at Newbiggin
http://www.netbsd.org/ / http://www.newbigginsailingclub.org/