This is on my windows test platform.
I have the following csv:
You have signed out successfully!,ar,لقد خرجت بنجاح!
I have the following table definition:
CREATE TABLE `translations` (
`sourcephrase` varchar(250) NOT NULL,
`language` char(5) NOT NULL,
`translatedphrase` varchar(250) CHARACTER SET utf8 DEFAULT NULL,
PRIMARY KEY (`sourcephrase`,`language`),
KEY `language` (`language`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
If I load this csv into table (via mysql workbench, import csv), I get the data just fine.
sourcephrase, language, translation
You have signed out successfully! ar لقد خرجت بنجاح!
If instead I run this php code (where psquery is just execute a prepared statement):
$sourcephrase="You have signed out successfully!";
$language="ar";
$translated="لقد خرجت بنجاح!";
$sql = "insert into translations (sourcephrase, language, translatedphrase) values (?,?,?)";
$this->DB->psquery($sql, array("sss", $sp, $language, $translated));
The table contains the following data:
You have signed out successfully! ar لقد خرجت بنجاØ!
Why am I getting a different result in php ? (I know its something utf8 related, but I can't see what). I don't believe it's mysql related, as the csv import is just fine.