In MySQL I have set my data field type to utf8_bin and i am storing data in Unicode. Texts are being properly displayed in web pages.
utf8_bin
I want to generate ex
This post solved my problem: https://stackoverflow.com/a/4762708/2349494
And this is what did the conversion:
print chr(255) . chr(254) . mb_convert_encoding($csv_output, 'UTF-16LE', 'UTF-8');
Earlier I was getting garbage characters now correct data is exported.