fix: full Unicode support in xml (#7428)

This commit is contained in:
Eduardo Speroni
2019-07-03 05:52:52 -03:00
committed by Manol Donev
parent 250eb31c6e
commit b8659e67c3
3 changed files with 31 additions and 5 deletions

View File

@ -100,17 +100,17 @@ function _HandleAmpEntities(found: string, decimalValue: string, hexValue: strin
}
const res = _ampCodes.get(wordValue);
if (res) {
return String.fromCharCode(res);
return String.fromCodePoint(res);
}
// Invalid word; so we just return it
return found;
}
if (decimalValue) {
return String.fromCharCode(parseInt(decimalValue, 10));
return String.fromCodePoint(parseInt(decimalValue, 10));
}
return String.fromCharCode(parseInt(hexValue, 16));
return String.fromCodePoint(parseInt(hexValue, 16));
}
export class XmlParser implements definition.XmlParser {