php.net |  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
Votes:1
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
Description:
------------
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:
---------------
mb_http_output("UTF-8");
mb_internal_encoding("UTF-8");

// 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-28 20:43 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [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: Thu Mar 28 08:01:28 2024 UTC