diff options
author | corvid <corvid@lavabit.com> | 2011-10-22 18:38:25 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2011-10-22 18:38:25 +0000 |
commit | 1f0c79090620e09aa281ff9ee14f816efb7d6f4f (patch) | |
tree | 8a05479dd0cd6009c943e00814eda643bad33e9a /src/dillo.cc | |
parent | bb81112acaf4a098192f9fe6e27491e1bd503eb6 (diff) |
reset LC_CTYPE to C (for the benefit of Turkic locales)
The standard solution to I and i being different letters in Turkic
locales is to make your own ASCIIfied strcasecmp/toupper/tolower,
but I'm not aware of us currently having any need/use for non-C
LC_CTYPE.
Diffstat (limited to 'src/dillo.cc')
-rw-r--r-- | src/dillo.cc | 10 |
1 files changed, 10 insertions, 0 deletions
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(); |