diff options
| author | Benjamin Southall <applemansigloo@gmail.com> | 2017-03-09 13:58:41 +0900 |
|---|---|---|
| committer | Benjamin Southall <applemansigloo@gmail.com> | 2017-03-09 13:58:41 +0900 |
| commit | bf1e627c5972b643806fb257c4831569d6a42b27 (patch) | |
| tree | 404e071364fa03847b340d1ef7e0da69e6a4ac5a /inc/functions.php | |
| parent | f36222c0e90dfffc50102bcd75e1af96221d8d7e (diff) | |
Thumbnails for PDFs / other things #6 When locale fails to be loaded fallback on C.UTF-8 instead of C, so that boards with unicode characters in the name are not stripped by escape_shell_args
Diffstat (limited to 'inc/functions.php')
| -rwxr-xr-x | inc/functions.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/inc/functions.php b/inc/functions.php index 8ed65521..7a666ca2 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -39,6 +39,9 @@ function init_locale($locale) { if (extension_loaded('gettext')) { if (setlocale(LC_ALL, $locale) === false) { //$error('The specified locale (' . $locale . ') does not exist on your platform!'); + // Fall back to C.UTF-8 instead of normal C, so we support unicode instead of just ASCII + setlocale(LC_ALL, "C.UTF-8"); + setlocale(LC_CTYPE, "C.UTF-8"); } bindtextdomain('tinyboard', './inc/locale'); bind_textdomain_codeset('tinyboard', 'UTF-8'); @@ -46,6 +49,9 @@ function init_locale($locale) { } else { if (_setlocale(LC_ALL, $locale) === false) { error('The specified locale (' . $locale . ') does not exist on your platform!'); + // Fall back to C.UTF-8 instead of normal C, so we support unicode instead of just ASCII + _setlocale(LC_ALL, "C.UTF-8"); + _setlocale(LC_CTYPE, "C.UTF-8"); } _bindtextdomain('tinyboard', './inc/locale'); _bind_textdomain_codeset('tinyboard', 'UTF-8'); |
