After going through about two dozen posts I'm officially stumped. I have a database with utf8_general_ci collated columns. Using PHPMyAdmin I am able to view the UTF-8 Data in the table correctly (At least as far as I can tell.) I thought what I wanted to do was simple enough. I have queried for the data in many ways, and I just want to echo the utf-8 value:
echo bin2hex("more…"); //note "…" is a special character
6d 6f 72 65 e2 80 a6 (Hex Value)
However if I just echo $row->value I get:
6d 6f 72 65 85
UTF-8 Encoding it gives:
6d 6f 72 65 c2 85
Most posts I've read have said to use mysql_set_charset("utf8") but this really screws things up:
6d 6f 72 65 26 61 63 69 72 63 3b 80 26 62 72 76 62 61 72 3b
and finally using mysql_set_charset("utf8") & utf8_encode($var):
6d 6f 72 65 26 61 63 69 72 63 3b c2 80 26 62 72 76 62 61 72 3b
I have also tried setting the UTF8 settings in PHP. Godaddy makes this a bit more difficult so I've done so using ini_set. However the mbstring.encoding_translation will not turn on.
// UTF8 settings
ini_set('mbstring.language', 'Neutral');
ini_set('mbstring.internal_encoding', 'UTF-8');
ini_set('mbstring.http_input', 'UTF-8');
ini_set('mbstring.http_output', 'UTF-8');
ini_set('mbstring.encoding_translation', 'On');
ini_set('mbstring.detect_order', 'auto');
ini_set('mbstring.substitute_character', 'long');
Any tips on what I need to do?