diff options
-rw-r--r-- | dw/findtext.cc | 4 | ||||
-rw-r--r-- | src/dillo.cc | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/dw/findtext.cc b/dw/findtext.cc index 9793db91..e7cd3597 100644 --- a/dw/findtext.cc +++ b/dw/findtext.cc @@ -216,6 +216,10 @@ bool FindtextState::unhighlight () return false; } +/** \todo If this is made UTF8-aware one day, we might want to + * setlocale(LC_CTYPE, "") for the duration of the search. See the comment in + * main() for why we normally keep it set to "C". + */ bool FindtextState::search0 (bool backwards, bool firstTrial) { if (iterator->getChar () == CharIterator::END) diff --git a/src/dillo.cc b/src/dillo.cc index b05cb16a..8c720e5a 100644 --- a/src/dillo.cc +++ b/src/dillo.cc @@ -321,6 +321,16 @@ int main(int argc, char **argv) } dFree(opt_argv); + + /* On X, the first fl_open_display() sets the LC_CTYPE aspect of the locale + * from the environment, so let's trigger it ourselves so that we can + * deal with this. For our purposes, this is very bad in Turkic locales + * where 'i' and 'I' are different letters, and strcasecmp(), toupper(), + * tolower() no longer work as expected. So we reset it to the C locale. + */ + fl_open_display(); + setlocale(LC_CTYPE, "C"); + // set the default values for the preferences a_Prefs_init(); |