I have MySQL database table "PRICES" that is set SET NAMES utf8mb4;
with colum name "TYPE" char(70) CHARACTER SET latin1 COLLATE latin1_swedish_ci
When I get the data in PHP 5.6.40 with Pear like this:
$DSN = "$db_schema://$db_username:$db_password@$db_host/$db_database";
$db = DB::connect($DSN);
$db->setFetchMode(DB_FETCHMODE_ASSOC);
$db->Query("SET NAMES utf8mb4");
$prices = $db->getAll("SELECT * FROM prices");
Now I expect the column "TYPE" in the variable $prices["type"]
to be some Cyrillic words but instead I get this Ñåìååí ñ äâå äåöà
I tried also:
$db->Query("SET NAMES utf8");
which get the same result as above
$db->Query("SET NAMES latin1");
which get this result => ������ � ��� ����
I tried to convert the last result with some php functions like utf8_encode() too, but things just get worst...
So, please, if somebody here knows where the issue is, I'm glad to hear your answers!
UPDATE
Here you can view the sql dump file for more details: https://pastebin.com/0pig4B1j