bug #3206876 [core] Work without mbstring installed.

This is patch from upstream php-gettext, which will be included in next
release there.
This commit is contained in:
Michal Čihař
2011-03-15 08:07:13 +01:00
parent 13fea458fb
commit 60933d667b
2 changed files with 7 additions and 7 deletions

View File

@@ -146,6 +146,7 @@
- rfe #1312657 [dbi] Default to mysqli extension. - rfe #1312657 [dbi] Default to mysqli extension.
- rfe #1168350 [interface] Add clear button to SQL edit box. - rfe #1168350 [interface] Add clear button to SQL edit box.
- [core] Update library PHPExcel to version 1.7.6 - [core] Update library PHPExcel to version 1.7.6
- bug #3206876 [core] Work without mbstring installed.
3.3.10.0 (not yet released) 3.3.10.0 (not yet released)
- patch #3147400 [structure] Aria table size printed as unknown, - patch #3147400 [structure] Aria table size printed as unknown,

View File

@@ -174,14 +174,13 @@ function _get_codeset($domain=null) {
* Convert the given string to the encoding set by bind_textdomain_codeset. * Convert the given string to the encoding set by bind_textdomain_codeset.
*/ */
function _encode($text) { function _encode($text) {
$source_encoding = mb_detect_encoding($text);
$target_encoding = _get_codeset(); $target_encoding = _get_codeset();
if ($source_encoding != $target_encoding) { if (function_exists("mb_detect_encoding")) {
return mb_convert_encoding($text, $target_encoding, $source_encoding); $source_encoding = mb_detect_encoding($text);
if ($source_encoding != $target_encoding)
$text = mb_convert_encoding($text, $target_encoding, $source_encoding);
} }
else {
return $text; return $text;
}
} }