How to display chinese characters in excel when I export from Coldfusion
Content:
Hi guys I am able to display chinese characters in a grid in html, but when i export the data to excel the chinese characters displays as question marks in excel. Database: Sql server Datatype: nvarchar Tried with charset = utf-8 & 16 while display but it still displays the same ???? This is my code: *******************************************************************************
******************************************************************************* I would seek ur valuable ideas to get this fixed. Thanks a lot ! Rgds Rafi
Comments
Hi Guys
Happy to inform u guys that I got the issue fixed and the chinese characters are now displaying.
The solution is, the <cfcontent ...tag though doesn't have a charset attribute u can embed it as a style of the type attribute. Like,
<cfcontent type="application/vnd.ms-excel charset=UTF-16">
and should be defined above the <cfheader ..tag.
Please donot forget to send me a thanking mail.
Cheers !!
Thanks for your post - I just had the same problem and your solution helped me. This is the way that is working for me:
Cheers!