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
This commit is contained in:
parent
f36222c0e9
commit
bf1e627c59
@ -39,6 +39,9 @@ function init_locale($locale) {
|
|||||||
if (extension_loaded('gettext')) {
|
if (extension_loaded('gettext')) {
|
||||||
if (setlocale(LC_ALL, $locale) === false) {
|
if (setlocale(LC_ALL, $locale) === false) {
|
||||||
//$error('The specified locale (' . $locale . ') does not exist on your platform!');
|
//$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');
|
bindtextdomain('tinyboard', './inc/locale');
|
||||||
bind_textdomain_codeset('tinyboard', 'UTF-8');
|
bind_textdomain_codeset('tinyboard', 'UTF-8');
|
||||||
@ -46,6 +49,9 @@ function init_locale($locale) {
|
|||||||
} else {
|
} else {
|
||||||
if (_setlocale(LC_ALL, $locale) === false) {
|
if (_setlocale(LC_ALL, $locale) === false) {
|
||||||
error('The specified locale (' . $locale . ') does not exist on your platform!');
|
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');
|
_bindtextdomain('tinyboard', './inc/locale');
|
||||||
_bind_textdomain_codeset('tinyboard', 'UTF-8');
|
_bind_textdomain_codeset('tinyboard', 'UTF-8');
|
||||||
|
Loading…
Reference in New Issue
Block a user