I've seen several questions asked on this topic but here's the short of the long: I have a db created in phpmyadmin that's using utf8_general_ci
collation and rows in some tables can have either English or Japanese text. I am displaying out these rows using a php mysqli query, but am getting gibberish out from it.
The legwork I've done includes the following:
Adding in a meta tag for the char set for the HTML header
meta http-equiv="Content-Type" content="text/html; charset=UTF8"
Explicitly telling mysqli connection to use UTF-8 via
set_charset()
and also sanity checking it withcharacter_set_name()
Verifying the collation of the database/pertinent tables/columns
Adding in some Japanese text extraneous of any mysql queries to verify the browser can render it
Making sure the php file(s) are UTF-8 encoded
Verifying the Japanese input is being taken properly to the database and in the php
Sanity check the database with a comparable test database using
utf8_general_ci
collation (in case the problem db/table/column was originally made with a different collation and changing it caused existing rows to be garbled)Verify the database collation and charset in the information_schema table, such that charset is utf8 and the collation is
utf8_general_ci
In the mysqli query attempt to convert the pertinent column to utf8 (this likes to throw an error, so it seems invalid)
All of the above checks out and I still get gibberish, hence I ask the question of if it's possible that the rows returned in a query can not match up with the collation of the db/table/column causing it to be rendered incorrectly.
For completeness, this is being done in a wampserver3 deployment with php 5.6.25, mysql 5.7.14, and phpmyadmin 4.6.4. The column that can take English or Japanese is set to TEXT type.
I'm completely stumped with this.