From 232a98524cdc9c97ad1c5a72ec0021e4b036a69d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20M=C3=BCller?= Date: Fri, 8 Feb 2013 17:49:54 +0100 Subject: [PATCH] some systems use en_US.UTF8 instead of en_US.UTF-8 --- lib/base.php | 4 ++-- lib/util.php | 11 +++++------ settings/templates/admin.php | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/base.php b/lib/base.php index 5bfdb0b7c0a..38ced09b81d 100644 --- a/lib/base.php +++ b/lib/base.php @@ -346,7 +346,7 @@ class OC { public static function init() { // register autoloader spl_autoload_register(array('OC', 'autoload')); - setlocale(LC_ALL, 'en_US.UTF-8'); + OC_Util::issetlocaleworking(); // set some stuff //ob_start(); @@ -498,7 +498,7 @@ class OC { // write error into log if locale can't be set if (OC_Util::issetlocaleworking() == false) { - OC_Log::write('core', 'setting locale to en_US.UTF-8 failed. Support is probably not installed on your system', OC_Log::ERROR); + OC_Log::write('core', 'setting locale to en_US.UTF-8/en_US.UTF8 failed. Support is probably not installed on your system', OC_Log::ERROR); } if (OC_Config::getValue('installed', false)) { if (OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax') == 'ajax') { diff --git a/lib/util.php b/lib/util.php index 9ce974619bc..27aea6996da 100755 --- a/lib/util.php +++ b/lib/util.php @@ -526,12 +526,11 @@ class OC_Util { return true; } - $result=setlocale(LC_ALL, 'en_US.UTF-8'); - if($result==false) { - return(false); - }else{ - return(true); - } + $result = setlocale(LC_ALL, 'en_US.UTF-8', 'en_US.UTF8'); + if($result == false) { + return false; + } + return true; } /** diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 9a9a691dcbf..32fc2694783 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -42,7 +42,7 @@ if (!$_['islocaleworking']) { t('Locale not working');?> - t('This ownCloud server can\'t set system locale to "en_US.UTF-8". This means that there might be problems with certain characters in file names. We strongly suggest to install the required packages on your system to support en_US.UTF-8.'); ?> + t('This ownCloud server can\'t set system locale to "en_US.UTF-8"/"en_US.UTF8". This means that there might be problems with certain characters in file names. We strongly suggest to install the required packages on your system to support en_US.UTF-8/en_US.UTF8.'); ?> -- 2.39.5