|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31946 Character set used in query not the same as result.
Submitted: 2005-02-12 15:08 UTC Modified: 2005-03-08 01:00 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: royberkeveld at gmail dot com Assigned:
Status: No Feedback Package: MySQL related
PHP Version: 5.0.3 OS: Windows XP Pro
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-02-12 15:08 UTC] royberkeveld at gmail dot com
When a script's internal character encoding is set to UTF-8, and a MySQL Query is formed, the result did not contain UTF-8 encoded data.

This changed when upgrading from PHP 5.0.2 to 5.0.3 - it worked fine in 5.0.2. It does not appear MySQL-related since nothing was changed to the databases. All databases are UTF-8 encoded and the standard character set is also UTF-8. I am using MySQL 4.1.9 on Apache 2

Reproduce code:

// just an example, can be any query
$result = mysql_query("select * from someplace");
$row = mysql_fetch_row($result);

echo $row[0];

Expected result:
UTF-8 encoded data with all characters intact

Actual result:
Missing characters due to conversion of UTF-8 database data to Latin-1


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-28 20:43 UTC]
Please try using this CVS snapshot:
For Windows:

 [2005-02-28 21:16 UTC] RoyBerkeveld at gmail dot com
I tested using the snapshot for Windows.

Latest snapshot doesn't fix anything. I suspect it might have something to do with the mysql client libraries, they changed with the upgrade from 5.0.2 to 5.0.3 (size increase from 200kb to 1mb).

I'm not sure weather this 'bug' was intended or not, since there is probably an a lot more elegant way to force mysql queries to be in a different encoding than to set the script's internal character set. I'm just stating that this method no longer works and the changelog doesn't mention anything about it. Neither do I know a better method, but that is, I believe, not of much concern to a bug report.
 [2005-03-08 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 03:02:00 2024 UTC