I'm trying to parse text data to a table in mySql and later on an SQL server. This text contains special characters such as: ⓜ. When the bit of text is still on PHP it's all fine but as soon as I use utf8_encode(teststring); it loses the character and changes it to â.
The only workaround that I found was to decode the string again when getting it back from the database but this is very inefficient when handling alot of data. Is there any work around?
Already tried utf8mb4 enconding and many other answers on the internet.
Example:
$test = "some string containing ⓜ";
print_r($test."</br>");
$test = utf8_encode($test);
print_r($test."</br>");
$test = utf8_decode($test);
print_r($test."</br>");
Result:
some string containing ⓜ
some string containing â
some string containing ⓜ
If I do not use the utf8_encode() I get parsing errors from the database: General error: 1366 Incorrect string value