|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-27 10:22 UTC] mooseyproductions at hotmail dot com
[2004-02-27 18:27 UTC] fmk@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 09:00:01 2025 UTC |
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????Ͼ??????????????????????????ǎ???Ԑ??????ѥ???噞????????? ?Ƅ???????????Ф??????????????