diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 2b56ceabceb..727a03690ef 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -4030,11 +4030,14 @@ function utf8_check($str) /** * Return an UTF-8 string encoded into OS filesystem encoding. This function is used to define * value to pass to filesystem PHP functions. - * @param $str String to encode (UTF-8) - * @return string Encoded string (UTF-8, ISO-8859-1) + * + * @param string $str String to encode (UTF-8) + * @return string Encoded string (UTF-8, ISO-8859-1) */ function dol_osencode($str) { + global $conf; + $tmp=ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0 if (empty($tmp) && ! empty($_SERVER["WINDIR"])) $tmp='iso-8859-1'; // By default for windows if (empty($tmp)) $tmp='utf-8'; // By default for other