1

i have problem when i parse xml because i have this caracter ö

<?xml version="1.0" encoding="UTF-8"?>
        <rsp stat="ok">
                <mediaid>abösjdk3</mediaid>
                <mediaurl>http://twitöic.com/abc123</mediaurl>
        </rsp>

the building:

parser error : Input is not proper UTF-8, indicate encoding !
    Bytes: 0x9A 0x74 0x68 0x65
             <mediaid>ab\232sjdk3</mediaid>
                      ^

other question please if want parse this > 6 < 12 month i will have problem,i not want replace > samone have solution?

2
  • Can you paste the relevant parts of the code? Commented Aug 5, 2011 at 11:11
  • i use GDataXmlNode to parse and in my xml file Commented Aug 5, 2011 at 11:15

2 Answers 2

5

You'll have this problem with any parser, not only with objective-c.

That character isn't encoded as UTF-8 and as such it will halt any parser.

Either remove the encoding information or change for the correct value.

Edited to answer a comment

i use GDataXmlNode to parse and in my xml file i not use <?xml version="1.0" encoding="UTF-8"?> – cs1.6

IF the original XML file does not have the encoding attribute, then either when you instantiate the parser, or load the XML file, inform the proper encoding, which I have no idea what it is.

Because for the way that the O.P. is posted, it implies that the character ö is encoded as \232. However, the decimal 232 in ISO-8859-1 represents the character è. The character ö is represented as \246.

Sign up to request clarification or add additional context in comments.

2 Comments

i use GDataXmlNode to parse and in my xml file i not use <?xml version="1.0" encoding="UTF-8"?>
The parser is working correctly, just as Paulo mentioned. But the on character ö isn't encode as UTF8. It could be any typo of encoding. The creator of the XML file will have to fixe there output, this is not something you can do.
0

Go through this, it will help...

2 Comments

Please inline any answers. This link is no longer active.
@Willster thanks for drawing the attention. The non-active link has rectified.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.