From: david dot kalosi at spordat dot sk Operating system: Windows XP SP1 PHP version: 5CVS-2005-05-03 (dev) PHP Bug Type: *Languages/Translation Bug description: inserting UTF-8 string into mysql
Description: ------------ I have a Mysql database with UTF-8 encoding and i am posting data from web also in UTF-8 encoding. The slovak character "č" is messed up - the results from the database are differ from the input. All other special characters are OK. Reproduce code: --------------- mysql> create table t (x varchar(64)) character set utf8; Query OK, 0 rows affected (0.21 sec) mysql> <script language="php"> header("Content-Type: text/html;charset=UTF-8"); $l_conn = mysql_connect("localhost", "formawww", "formawww"); mysql_select_db("forma", $l_conn); echo "<form name=\"test\" method=\"POST\" action=\"test.php\">"; echo "<input type=\"text\" name=\"str\">"; echo "<input type=\"hidden\" name=\"insert\" value=\"1\">"; echo "<input type=\"submit\"></form>"; if (isset($_REQUEST["insert"])) { $l_insert = mysql_query ("insert into t values ('" . $_REQUEST["str"]."')"); } $l_select = mysql_query("select * from t"); echo "------------------<br>"; while ($l_row = mysql_fetch_assoc($l_select)) { echo $l_row["x"] . "<br>\n"; } </script> Expected result: ---------------- enter the following values into the form ľščťžýáíéúäô and the following output is produces ľšĿťžýáíéúäô the third character is corrupted. -- Edit bug report at http://bugs.php.net/?id=32927&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32927&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32927&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32927&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32927&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32927&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32927&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32927&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32927&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32927&r=support Expected behavior: http://bugs.php.net/fix.php?id=32927&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32927&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32927&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32927&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32927&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32927&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32927&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32927&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32927&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32927&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32927&r=mysqlcfg