diff options
-rwxr-xr-x | inc/poche/Tools.class.php | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 3f68cff5..2ee86c74 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php | |||
@@ -237,18 +237,25 @@ final class Tools | |||
237 | * | 237 | * |
238 | * @param $data | 238 | * @param $data |
239 | */ | 239 | */ |
240 | public static function utf8ize($data) | 240 | public static function utf8ize($data) |
241 | { | 241 | { |
242 | if (is_array($data)) | 242 | if (is_array($data)) |
243 | { | 243 | { |
244 | foreach ($data as $k => $v) | 244 | foreach ($data as $k => $v) |
245 | { | 245 | { |
246 | $data[$k] = self::utf8ize($v); | 246 | $data[$k] = self::utf8ize($v); |
247 | } | 247 | } |
248 | } | 248 | } |
249 | else if (is_string ($data)) | 249 | else if (is_string ($data)) |
250 | { | 250 | { |
251 | return utf8_encode($data); | 251 | if ('' == mb_detect_encoding($data)) |
252 | { | ||
253 | return utf8_encode($data); | ||
254 | } | ||
255 | else | ||
256 | { | ||
257 | return $data; | ||
258 | } | ||
252 | } | 259 | } |
253 | return $data; | 260 | return $data; |
254 | } | 261 | } |