URL:
<http://savannah.gnu.org/bugs/?42233>
Summary: wcwidth(3) used on UCS4/UTF-32 codepoints
Project: GNU troff
Submitted by: None
Submitted on: Tue 29 Apr 2014 11:20:30 AM UTC
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
I think currently groff makes false use of wcwidth(3): if it finds the
`unicode' property in a `DESC' file it uses wcwidth(3) to determine the visual
width, not taking into account the current locale, but which wcwidth(3)
depends upon.
Also groff uses UCS4 / UTF-32 code points, but (unfortunately) neither ISO C
nor POSIX specify the character set that wchar_t uses, and in fact at least
the Citrus project (*BSD and deriviatives) uses some homebrew bit pattern for
several (asian) locales.
Whereas GNULib also offers wcwidth-replacement functions which are defined to
use UCS4 / UTF-32 code points, one of my personal projects is a Unicode aware
library, and, short, i'm attaching a patch that implements a
`unicode_is_fullwidth()' functionality, which is what the current code
requires to have.
The neat side effect of that is that the entire GNULib can be
unhooked and removed from groff(1).
The attached program `uniwidth.c' can be used to verify that the
implementation is correct.
So, after applying patches
`0001-Drop-wcwidth-3-in-favour-of-Unicode-6.3.0-homebrew-v.patch' and
`0002-Unhook-GNUlib.patch' all that is needed to bring groff into a much nicer
state is
$ git rm -rf src/libs/gnulib && git commit -m 'Drop GNUlib'
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Tue 29 Apr 2014 11:20:30 AM UTC Name:
0001-Drop-wcwidth-3-in-favour-of-Unicode-6.3.0-homebrew-v.patch Size: 6kB
By: None
<http://savannah.gnu.org/bugs/download.php?file_id=31271>
-------------------------------------------------------
Date: Tue 29 Apr 2014 11:20:30 AM UTC Name: 0002-Unhook-GNUlib.patch Size:
7kB By: None
<http://savannah.gnu.org/bugs/download.php?file_id=31272>
-------------------------------------------------------
Date: Tue 29 Apr 2014 11:20:30 AM UTC Name: uniwidth.c Size: 3kB By: None
<http://savannah.gnu.org/bugs/download.php?file_id=31273>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?42233>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
_______________________________________________
bug-groff mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-groff