mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 357830: use parseFromBuffer instead of doing byte->string conversion manually, to benefit from nsDomParser's charset detection, r=mano
This commit is contained in:
parent
a8da5788c4
commit
24ad3c798b
@ -1158,12 +1158,9 @@ Engine.prototype = {
|
||||
|
||||
switch (aEngine._dataType) {
|
||||
case SEARCH_DATA_XML:
|
||||
var dataString = bytesToString(aBytes, "UTF-8");
|
||||
ENSURE(dataString, "_onLoad: Couldn't convert byte array!",
|
||||
Cr.NS_ERROR_FAILURE);
|
||||
var parser = Cc["@mozilla.org/xmlextras/domparser;1"].
|
||||
createInstance(Ci.nsIDOMParser);
|
||||
var doc = parser.parseFromString(dataString, "text/xml");
|
||||
var doc = parser.parseFromBuffer(aBytes, aBytes.length, "text/xml");
|
||||
aEngine._data = doc.documentElement;
|
||||
break;
|
||||
case SEARCH_DATA_TEXT:
|
||||
|
Loading…
Reference in New Issue
Block a user