Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » XmlParser encoding detection bugfix.
XmlParser encoding detection bugfix. [message #60146] Thu, 14 September 2023 02:07 Go to next message
zsolt is currently offline  zsolt
Messages: 697
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++);
 		}
Re: XmlParser encoding detection bugfix. [message #60152 is a reply to message #60146] Thu, 14 September 2023 13:23 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Ops & thanks.
Previous Topic: GLCtrl switch between perspective and ortho mode
Next Topic: Bugfix: XmlParser in endless loop
Goto Forum:
  


Current Time: Sat May 04 01:29:34 CEST 2024

Total time taken to generate the page: 0.02640 seconds