diff options
author | Anders Kaseorg <[email protected]> | 2017-01-20 14:49:24 -0500 |
---|---|---|
committer | Anders Kaseorg <[email protected]> | 2017-01-21 15:01:14 -0500 |
commit | 526096f06a7916fca71af48814c90d33c8e02641 (patch) | |
tree | 5b46d88a3143d669cf23a5539b8d7c7a598660ac /lib/gettext/gettext.inc | |
parent | e3cfa33ba92c620d1e302ee253da259e1abf4589 (diff) |
lib: Upgrade php-gettext from 1.0.11 to 1.0.12
https://launchpad.net/php-gettext
The local change to rename the gettext_reader function to
__construct (commit 00b6b66827c5ce0c103399f2742581fa90d50a97) has been
preserved.
Signed-off-by: Anders Kaseorg <[email protected]>
Diffstat (limited to 'lib/gettext/gettext.inc')
-rw-r--r-- | lib/gettext/gettext.inc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/gettext/gettext.inc b/lib/gettext/gettext.inc index 00b966692..c9f7dc016 100644 --- a/lib/gettext/gettext.inc +++ b/lib/gettext/gettext.inc @@ -174,14 +174,13 @@ 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); - $target_encoding = _get_codeset(); - if ($source_encoding != $target_encoding) { - return mb_convert_encoding($text, $target_encoding, $source_encoding); - } - else { - return $text; - } + if ($source_encoding != $target_encoding) + $text = mb_convert_encoding($text, $target_encoding, $source_encoding); + } + return $text; } |