I have created a program that is using an excel (.xls) file as a database record. I can query it and get results fine, the whole program pretty much works, except it is falling over when it comes to any unicode characters. Once the script is finished, it writes the results to a tab delimited .txt file but I'm getting Question marks (?) in replace of some characters, it's also showing things like x92 in replace of apostrophes (').
I've tried lots of things such as changing <meta charset="UTF-8">
from iso-8859-1, and that's when the x92 seemed to appear, though I'm not sure about that.
I'm pretty sure the issue has something to do with how ODBC is retrieving the data. The original data source is fine, all unicode characters etc appear fine, but after I extract the data, I echo to screen before doing anything else with the data and I can see the question marks appearing there.
I currently connect to excel with this code
$connection = odbc_connect("Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=$excelFile;Client_CSet=UTF-8;DefaultDir=$excelDir;" , "Server_CSet=Windows-1251", "");
I added the "Client_CSet=UTF-8;" and , "Server_CSet=Windows-1251" that I found from many google searches I have made to try and fix this but it hasn't changed a thing. I'm completely stumped.
How the value is storing in database? if the database value contains the question marks instead of unicode characters then you've to change the collation of that table as well as the collation of that field.