I've been following a tutorial (http://www.raywenderlich.com/14172/how-to-parse-html-on-ios) about parsing html in iOS with Hpple, and I have noticed that using hpple to get a text node from its parent html element returns a string that is a different length than it is if I just copy/paste the text into xcode. For example, this gives a string with a length of 69:
NSString *str = [[element firstChild] content];
where the element looks like this on the site:
<a href="/home/programs/1373">A Conversation Between Friends: Language, Love, and The Writing Life</a>
...whereas copy/pasting the text into the code:
NSString *str = @"A Conversation Between Friends: Language, Love, and The Writing Life";
...gives a string with length 68 (or at least these are the result I get with NSString's length function). So from this I conclude that the returned string and string I created from copying and pasting must be encoded differently or something. Is this a correct assumption?
If needed, I can provide more of the code for context. Thanks in advance for any help.
NSString *str = [[element firstChild] content];
where the element looks like this on the site:
<a href="/home/programs/1373">A Conversation Between Friends: Language, Love, and The Writing Life</a>
...whereas copy/pasting the text into the code:
NSString *str = @"A Conversation Between Friends: Language, Love, and The Writing Life";
...gives a string with length 68 (or at least these are the result I get with NSString's length function). So from this I conclude that the returned string and string I created from copying and pasting must be encoded differently or something. Is this a correct assumption?
If needed, I can provide more of the code for context. Thanks in advance for any help.
Last edited: