views:

114

answers:

2

Hi all

 <Feeds>
<channel>
    <ctitle>YouTube</ctitle>
    <cdescription>YouTube - Recently added videos</cdescription>
    <items>
        <recentlyAdded>        <item>
    <serverItemId>1</serverItemId>
       <title>Fan Video CARS</title>
       <author>mikar1</author>
       <guid isPermaLink='false'></guid>
       <link>http://www.youtube.com/watch?v=y7ssHOBFvGk&amp;amp;feature=youtube_gdata&lt;/link&gt;
       <pubDate></pubDate>
       <description>

            <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&lt;/url&gt;
            </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 ..........

+2  A: 

ñ 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.

Lucero
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!"ñ" This is the character which is transformed when server sent the data to client side. What Encoding should be used to properly handle such kind of characters. ?
Ansari
Unless the server specifies another encoding explicitly (in the XML declaration and/or in the Content-Encoding HTTP header), UTF-8 is the default. http://www.w3.org/TR/2008/REC-xml-20081126/#charencoding states: "In the absence of information provided by an external transport protocol (e.g. HTTP or MIME), it is a fatal error for an entity including an encoding declaration to be presented to the XML processor in an encoding other than that named in the declaration, or for an entity which begins with neither a Byte Order Mark nor an encoding declaration to use an encoding other than UTF-8."
Lucero
A: 
Ansari