Reputation: 15817
I generate some xml in-browser and set it as data-uri for a link. When I click the link it is opened, but contents is recognized as ASCII and the text is garbled.
How do I make the content of the generated file be utf-8?
The xml starts with prolog <?xml version="1.0" encoding="utf-8" ?>
but this doesn't help.
Upvotes: 2
Views: 890
Reputation: 15817
So the answer is rather straightforward.
I added the BOM mark \uFEFF
to the beginning of the generated file and it worked fine. It looks tike this:
\uFEFF<?xml version="1.0" encoding="utf-8" ?> ...
Upvotes: 2