I have created an excel in which it has Thai and Vietnamese language. My problem is that it is showing these characters as question marks.
My code is below
$worksheet->write($i, 5, iconv("UTF-8", "ISO-8859-1//TRANSLIT", html_entity_decode($text)), $mainquest);
I have also tried all the other ISO standards. I put ISO-8859-1 for french language support. I also tried the mb_convert_encoding
but no progress.
Is there any solutions for this?
The encoding charset is not the same as French for Vietnamese and Thai
For Vietnamese (Windows) - charset=windows-1258
For Thai (Windows) -charset=windows-874
so for Thai:
$worksheet->write($i, 5, iconv("UTF-8", "windows-874",html_entity_decode($text)), $mainquest);
and for Vietnamese:
$worksheet->write($i, 5, iconv("UTF-8", "windows-1258",html_entity_decode($text)), $mainquest);
If switching the library is an option I'd suggest to use phpexcel. It is UTF8-based, which means you shouldn't get into trouble with character encoding at all (if everything else is neatly set to utf-8 in your workflow – db,files, webserver). Never had any problems with this library so far, while having generated spread sheets with all kind of special characters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With