Decode XML metadata as UTF-8

XML uses UTF-8 by default, which needs to be decoded to a Javascript
String prior to feeding it to the DOMParser.
In an ideal world, the XML would actually be analyzed and the specified
charset would be used, however that does not seem feasible unless JS
engines get iconv bindings.

Fixes GH-1692
This commit is contained in:
Nils Maier 2012-05-27 22:49:28 +02:00
parent e9632120c4
commit 40b9be137f
2 changed files with 10 additions and 1 deletions

View file

@ -302,6 +302,10 @@ function stringToPDFString(str) {
return str2;
}
function stringToUTF8String(str) {
return decodeURIComponent(escape(str));
}
function isBool(v) {
return typeof v == 'boolean';
}