mb_* functions don't know some windows-* charsets (bug #940638).

This commit is contained in:
Michal Čihař
2004-04-26 08:34:12 +00:00
parent a11bf5f2df
commit 93b8065584
2 changed files with 7 additions and 2 deletions

View File

@@ -5,6 +5,10 @@ phpMyAdmin - Changelog
$Id$
$Source$
2004-04-26 Michal Cihar <michal@cihar.com>
* libraries/string.lib.php: mb_* functions don't know some windows-*
charsets (bug #940638).
2004-04-22 Michal Cihar <michal@cihar.com>
* libraries/export/sql.php: Invalid SQL on empty table export (bug
#939918).

View File

@@ -41,7 +41,8 @@ function PMA_strlen($string)
{
if (defined('PMA_MULTIBYTE_ENCODING')) {
return mb_strlen($string);
} elseif($GLOBALS['PMA_has_mbstr']) {
// windows-* charsets are not multibyte and not supported by mb_*
} elseif($GLOBALS['PMA_has_mbstr'] && substr($GLOBALS['charset'],0,8) != 'windows-') {
return mb_strlen($string, $GLOBALS['charset']);
} else {
return strlen($string);
@@ -65,7 +66,7 @@ function PMA_substr($string, $start, $length = 2147483647)
{
if (defined('PMA_MULTIBYTE_ENCODING')) {
return mb_substr($string, $start, $length);
} elseif($GLOBALS['PMA_has_mbstr']) {
} elseif($GLOBALS['PMA_has_mbstr'] && substr($GLOBALS['charset'],0,8) != 'windows-') {
return mb_substr($string, $start, $length, $GLOBALS['charset']);
} else {
return substr($string, $start, $length);