From 2301fd651bca6ea96fce761f077ab300a5a49bb0 Mon Sep 17 00:00:00 2001 From: "J.M" Date: Mon, 13 May 2013 11:32:41 +0200 Subject: [PATCH] Update PHP-gettext to 1.0.11 --- libraries/php-gettext/gettext.inc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libraries/php-gettext/gettext.inc b/libraries/php-gettext/gettext.inc index c9f7dc0168..00b966692c 100644 --- a/libraries/php-gettext/gettext.inc +++ b/libraries/php-gettext/gettext.inc @@ -174,13 +174,14 @@ function _get_codeset($domain=null) { * Convert the given string to the encoding set by bind_textdomain_codeset. */ function _encode($text) { - $target_encoding = _get_codeset(); - if (function_exists("mb_detect_encoding")) { $source_encoding = mb_detect_encoding($text); - if ($source_encoding != $target_encoding) - $text = mb_convert_encoding($text, $target_encoding, $source_encoding); - } - return $text; + $target_encoding = _get_codeset(); + if ($source_encoding != $target_encoding) { + return mb_convert_encoding($text, $target_encoding, $source_encoding); + } + else { + return $text; + } }