#27416 [NEW]: Accents not supported by mssql functions

From: Date: Fri, 27 Feb 2004 14:03:03 +0000
Subject: #27416 [NEW]: Accents not supported by mssql functions
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-55647@lists.php.net to get a copy of this message
From: mooseyproductions at hotmail dot com Operating system: Windows 2000/XP PHP version: 4.3.4 PHP Bug Type: MSSQL related Bug description: Accents not supported by mssql functions Description: ------------ When reading data from a SQL Server database, certain ASCII characters are incorrectly retrieved. Entering accented characters into the database works fine, however reading them from the database gives unexpected results. ASCII chars 33 - 255 entered into database: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ (This appears fine when looking at the database using MS Enterprise Manager) Result from read query: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~__'Ÿ".ÅÎ^%So_zYÿ­½œÏ¾Ýõù¸¦®ªð©îøñýüïæôú÷û§¯¬«ó¨·µ¶ÇŽ’€ÔÒÓÞÖ×ØÑ¥ãàâ噞ëéêšíèá… ƒÆ„†‘‡Š‚ˆ‰¡Œ‹Ð¤•¢“ä”ö›—£–ìç˜ It appears that characters after ASCII #127 are incorrectly returned from the database. Using SQL Server 7.0 (ISO 8859-1 charset) Reproduce code: --------------- $string = ''; for ($i = 33; $i <= 255; $i++) { $string .= chr($i); } $db->query("UPDATE Test SET charset = 0x".bin2hex($string)." WHERE rowID = 1"); $result = $db->query("SELECT charset FROM Test WHERE rowID = 1"); $row = $db->getAssoc($result); echo $row['charset']; Expected result: ---------------- I expected to see what I had previously entered into the database. All text that contains accents is wrongly displayed. Expected: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ Actual result: -------------- Actual: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~__'Ÿ".ÅÎ^%So_zYÿ­½œÏ¾Ýõù¸¦®ªð©îøñýüïæôú÷û§¯¬«ó¨·µ¶ÇŽ’€ÔÒÓÞÖ×ØÑ¥ãàâ噞ëéêšíèá… ƒÆ„†‘‡Š‚ˆ‰¡Œ‹Ð¤•¢“ä”ö›—£–ìç˜ -- Edit bug report at http://bugs.php.net/?id=27416&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27416&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27416&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27416&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27416&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27416&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27416&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27416&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27416&r=support Expected behavior: http://bugs.php.net/fix.php?id=27416&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27416&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27416&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27416&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27416&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27416&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27416&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27416&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27416&r=float

« previous php.bugs (#55647) next »