Follow-up Comment #16, bug #28359 (project texinfo): Text::CharWidth in fact is not very good. This is simply a frontend to wcswidth and friends. But this is not what we need here, since the encoding is the document encoding, not the locale encoding. As shown by the translation issue, switching locales reliably cannot easily be done when using the system locales implementation.
Fortunately I found some potential replacements: http://search.cpan.org/~audreyt/Unicode-EastAsianWidth-1.30/ is very simple, pure perl. It allows to find the width of east asian characters. http://search.cpan.org/~nezumi/Unicode-LineBreak-1.007.520/ is also interesting since it additionnally handle the issue of detecting linebreaks. It is mixed C/perl, and much more complicated, however. But it could replace the current end of line cutting code. I am still undecided regarding what to use. The most comprehensive would certainly be along * use a difference code when Unicode-LineBreak is installed that delegates end of line breaking to this module * otherwise use Unicode-EastAsianWidth and expand the already existing code to use the right length and use the additional properties to decide where to break lines. A copy of Unicode-EastAsianWidth could be shipped in texinfo, in the same way than libintl-perl to be used if needed. I am a bit unwilling to complicate that much, but I can't decide what approach is the better at the same time... _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?28359> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
