src/viewer/text/search.c (lowered_string):

#if defined(CONFIG_UTF_8) && defined(HAVE_WCTYPE_H)
                        ret[textlen] = utf8 ? towlower(ret[textlen]) : 
tolower(ret[textlen]);
#else
                        ret[textlen] = tolower(ret[textlen]);
#endif

If CONFIG_UTF_8 is defined, then ret[textlen] is unicode_val_T.
ELinks assumes towlower will convert it to the corresponding
lower-case unicode_val_T.  However, towlower is specified to work
with wchar_t, which does not have to be UCS-4.  In Windows, it
is UTF-16; and in NetBSD, it apparently depends on the locale:
<http://mail.nl.linux.org/linux-utf8/2001-06/msg00074.html>
<ftp://ftp.itojun.org/pub/paper/itojun-freenix2001-presen.ps.gz>

If __STDC_ISO_10646__ is defined, that means any Unicode
character number that fits in wchar_t will be treated as Unicode,
regardless of locale.  But if it is not defined, then Unicode
support may depend on the locale if it even exists at all.
So ELinks cannot portably use towlower for Unicode in that case.
In one of my recent patches, I added a unicode_fold_label_case
function that could perhaps be used here (in which case, it
should also be renamed).

Attachment: pgp2jaC1AC8Rf.pgp
Description: PGP signature

_______________________________________________
elinks-dev mailing list
elinks-dev@linuxfromscratch.org
http://linuxfromscratch.org/mailman/listinfo/elinks-dev

Reply via email to