Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem parsing XML with encoding "US-ASCII" in AQXMLparser #4

Open
GerTeunis opened this issue Apr 6, 2010 · 1 comment
Open

Problem parsing XML with encoding "US-ASCII" in AQXMLparser #4

GerTeunis opened this issue Apr 6, 2010 · 1 comment

Comments

@GerTeunis
Copy link

The parsing seems to keep starting over and over.
Perhaps the US-ASCII isn't detected/used correctly.
"US-ASCII is upwards-compatible with UTF-8 (an US-ASCII string is also a UTF-8 string, see [RFC 3629])"

When I manually change the encoding inside the xml to "utf-8" it seems to work okay.

@GerTeunis
Copy link
Author

I've added a rather temporary/dirty fix by added the following lines of code to AQXMLParser.m (line 371 in __startDocument)

if ([[[NSString stringWithCString:encoding encoding:NSUTF8StringEncoding] lowercaseString] isEqualToString:@"us-ascii"]) {
encoding = "utf-8";
}

I know; dirty but it works for the time being.
There doesn't seem to be a good stricmp or strcmpi available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant