Ansari
Ansari

Reputation: 1935

NSXMLParser, Issue with ASCII Character Set

YouTube YouTube - Recently added videos 1 Fan Video CARS mikar1 http://www.youtube.com/watch?v=y7ssHOBFvGk&feature=youtube_gdata

            <descriptionTitle>Fan Video CARS</descriptionTitle>
            <descriptionText>THE REALSONG OF THIS VIDEOS IS REAL GONE, BUT FOR COPYRIGHTS RASONS.....YOUTUBE FORCE ME A CHANGE THE SONG :s Un pequeño video, de la pelicula Cars!</descriptionText>
            <added></added>
            <airDate></airDate>
                <duration></duration>                
                <Views></Views>
                <ratings>4.340909</ratings>
                <From></From>
            </description>
            <thumbnail>
                <height>100</height>
                <width>100</width>
                <url>http://i.ytimg.com/vi/y7ssHOBFvGk/2.jpg</url>
            </thumbnail>                
       </item>

    </recentlyAdded>
    </items>
</channel>

I am using NSXMLParser, and when it reaches the it blows up. It breaks the text to pieces "THE REALSONG OF THIS VIDEOS IS REAL GONE, BUT FOR COPYRIGHTS RASONS.....YOUTUBE FORCE ME A CHANGE THE SONG :s Un peque" And next should be "ño" but it just quit the parsing there and further tags are being handled. :(

It always does with the ISO 8859 1 Character cames in )

Any quick idea ???

Thanks in Advance ..........

Upvotes: 0

Views: 536

Answers (2)

Ansari
Ansari

Reputation: 1935

Actually, on XML Server applies the htmlentities() method, which encodes the data and put the html entity names like " Ã, ñ" When parser tries to read these codes, it fails.

In above xml "Un pequeño video, de la pelicula Cars!" which is transformed to Un pequeño video, de la pelicula Cars!".

So, what could be the possible issue with parser....

Upvotes: 0

Lucero
Lucero

Reputation: 60190

ñ is not ASCII (7-bit)! You need to use the proper charset to parse the XML, which looks like it would be UTF-8 in this case.

Upvotes: 2

Related Questions