You need to sign in to do that
Don't have an account?
A problem with character encoding
I want to save a VF page as MS Word file. So I've added the attribute
contentType="application/vnd.ms-word#Test.doc"
to the apex:page tag. This works but some characters in the final file are replaced with another combinations. For example the hyphen is replaced with —, apostrophe - with ’ and so on. The problem is obviously related to character encoding. It can be solved with modified attribute value
contentType="application/vnd.ms-word; charset=Windows-1252"
That's fine, all text is shown normally. But I need also the default file name in this attribute like this
contentType="application/vnd.ms-word#Test.doc; charset=Windows-1252"
And this value gives the incorrect encoding again as if I remove charset value. So I can get either the right encoding or the default file name. But I need them simultaneously! I've dug up all the Internet but without any success. Also I tried to add META tag to the page and to modify HTTP headers directly but it didn't work. Can anybody help me with it?
can you trty the following:
contentType="application/vnd.ms-word; charset=Windows-1252#Test.Doc"
That's exactly what fixes it, thanks a million.