On 03/06/2010 12:03 AM, Joseph S. Myers wrote:
On Fri, 5 Mar 2010, Ian Lance Taylor wrote:
Dave Korn <dave.korn.cyg...@googlemail.com> writes:
I think you'll probably have to use plain old iswalpha. Looking at opts.c,
I'm guessing you're trying to extend the help string format to allow unicode?
Note that it may be OK to use iswalpha strictly on command line
options, but using it anywhere else gets you into a set of issues
around -finput-charset and -fexec-charset.
The present issue is help text, as produced by gettext (which produces
output in the locale's LC_CTYPE, calling iconv internally as needed). See
my discussion at <http://gcc.gnu.org/ml/gcc-patches/2010-02/msg01074.html>
of the issues with line breaking given a string of multibyte characters,
whose display width may also vary.
I don't know if there's an existing free software implementation of UAX#14
(Unicode Line Breaking Algorithm) suitable for use in GCC; that would be
the very heavyweight approach. I also don't know if that algorithm would
actually work well for the peculiarities of option help strings, not
having studied the details of it. Hence the suggestion that the existing
algorithm in opts.c could be reworked to check for L'-', L'/', L' ' and
use iswalpha.
Thank you all to that replied. I finally include <wctype.h> on intl.c and use
isw* strictly to handle the wide-character help string.
The updated patch for the issue that Joseph mentioned is at
http://gcc.gnu.org/ml/gcc-patches/2010-03/msg00364.html. Any advices will be
appreciated.
Thanks
Pearly