Home » U++ Library support » U++ Core » XmlParser encoding detection bugfix.
XmlParser encoding detection bugfix. [message #60146] |
Thu, 14 September 2023 02:07 |
zsolt
Messages: 698 Registered: December 2005 Location: Budapest, Hungary
|
Contributor |
|
|
Now works with XML headers like this:
<?xml version="1.0" encoding="WINDOWS-1250" standalone="yes" ?>
(there is something other also after encoding property)
@@ -395,21 +395,21 @@ void XmlParser::Next()
int q = tagtext.Find("encoding");
if(q < 0)
return;
q = tagtext.Find('\"', q);
if(q < 0)
return;
q++;
int w = tagtext.Find('\"', q);
if(w < 0)
return;
- q = CharsetByName(tagtext.Mid(q, w));
+ q = CharsetByName(tagtext.Mid(q, w - q));
if(q)
scharset = q;
return;
}
if(!HasMore())
throw XmlError("Unterminated processing info");
if(*term == '\n')
line++;
tagtext.Cat(*term++);
}
|
|
|
|
Goto Forum:
Current Time: Wed Dec 04 16:51:24 CET 2024
Total time taken to generate the page: 0.01355 seconds
|