From 2fc7634686673325c6daf5f9de724e338afa1a5b Mon Sep 17 00:00:00 2001 From: Robin Johnson Date: Sun, 11 Aug 2002 07:27:36 +0000 Subject: [PATCH] Fix for bug #593386 might need more work depending on character set research. We will need to end up knowing the character set MySQL is using to do it totally right. --- ChangeLog | 6 ++++++ libraries/string.lib.php3 | 21 +++++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9472aabc2..0591bfc6b 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,12 @@ phpMyAdmin - Changelog $Id$ $Source$ +2002-08-10 Robin Johnson + * libraries/string.lib.php3: + - Fix for bug #593386 might need more work depending on character set + research. We will need to end up knowing the character set MySQL is + using to do it totally right. + 2002-08-10 Marc Delisle * lang/french: update. diff --git a/libraries/string.lib.php3 b/libraries/string.lib.php3 index 1262693c6..df124b83e 100644 --- a/libraries/string.lib.php3 +++ b/libraries/string.lib.php3 @@ -228,6 +228,10 @@ if (!defined('PMA_STR_LIB_INCLUDED')) { /** * Checks if a character is an accented character * + * @note Presently this only works for some + * character sets. More work may be + * needed to fix it. + * * @param string character to check for * * @return boolean whether the character is an upper alphabetic one or @@ -237,14 +241,19 @@ if (!defined('PMA_STR_LIB_INCLUDED')) { */ function PMA_STR_isAccented($c) { - $ord_min1 = 128; //ord('A'); - $ord_max1 = 154; //ord('Z'); - $ord_min2 = 128; //ord('A'); - $ord_max2 = 154; //ord('Z'); + + $ord_min1 = 192; //ord('A'); + $ord_max1 = 214; //ord('Z'); + $ord_min2 = 216; //ord('A'); + $ord_max2 = 246; //ord('Z'); + $ord_min3 = 248; //ord('A'); + $ord_max3 = 255; //ord('Z'); + $ord_c = ord($c); - return (PMA_STR_numberInRangeInclusive($ord_c, $ord_min1, $ord_max1) - || PMA_STR_numberInRangeInclusive($ord_c, $ord_min2, $ord_max2)); + return PMA_STR_numberInRangeInclusive($ord_c, $ord_min1, $ord_max1) + || PMA_STR_numberInRangeInclusive($ord_c, $ord_min2, $ord_max2) + || PMA_STR_numberInRangeInclusive($ord_c, $ord_min2, $ord_max2); } // end of the "PMA_STR_isAccented()" function