Using this rtf class, I see my special characters getting converted, like é becomes \'C3\'A9
(that part is probably not the problem)
Once I get it in rtf using php header, the resulting character (é) is seen as é
.
header("Content-type: application/rtf; charset=utf-8");
header("Content-Disposition: attachment; filename=$file_rtf");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
Strange! My file is saved in utf-8, for information.
I had a similar problem while getting excel, but that is solved using
$text = mb_convert_encoding($text,'utf-16','utf-8');
This is not working for rtf. Thanks for any help.
PS. My file is saved with utf-8 encoding thro' DW, and my mysql default charset is also utf-8. I don't have a problem when I display a character directly from the database, but this problem is seen only when I type a special character directly into the page before to use the header.
Cheers.
Well, finally I solved it using:
mb_convert_encoding($text,'ISO-8859-15','utf-8');
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