ID:               41957
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jhala at uoregon dot edu
-Status:           Open
+Status:           Bogus
 Bug Type:         MySQL related
 Operating System: Vista/Fedora 7/WinXP
 PHP Version:      5.2.3
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:
------------------------------------------------------------------------

[2007-07-10 21:41:48] jhala at uoregon dot edu

Description:
------------
I have a fully UTF-8 MySQL database with a fully UTF-8 table. I have a
php page which has "<meta http-equiv="content-type"
content="application/xhtml+xml; charset=utf-8" />" at the top of the
html section and "mysql_set_charset("utf8");" after my connection.  I
have all my php.ini mbstring stuff configured for utf-8:

mbstring.language = Neutral
mbstring.internal_encoding = UTF-8
mbstring.http_input = auto
mbstring.encoding_translation = On
mbstring.detect_order = auto

and for what it's worth, echo mb_internal_encoding(); reports "UTF-8"
and mysql_client_encoding(); reports "utf8".


Reproduce code:
---------------
$con = mysql_connect('localhost', 'user', 'password');
mysql_select_db("database", $con);
mysql_set_charset("utf8");

$query = "SELECT japanese_terms.term_lang, language_en FROM
japanese_terms, languages ";
$query .="WHERE japanese_terms.term_id = languages.language_id ORDER BY
term_id";
$result = mysql_query($query);
while( $row = mysql_fetch_row($result))
{
  foreach($row as $field)
    { print($field . "<br />"); }
}

Expected result:
----------------
I expect the UTF-8 data to display properly, and as UTF-8 data.  When I
run the same query that pulls out (in this case, Japanese, but say any)
UTF8 data, it displays properly in MySQL Query Browser.

Actual result:
--------------
With php in the above context however, it does not.  Instead, it prints
a ? corresponding to each character.  When I use mb_detect_encoding();
on each such string, it tells me they are encoded as "ASCII" instead of
expected "UTF-8".


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41957&edit=1

Reply via email to