UTF8 from web conten .xml file to NSString

Posted by mongeta on Stack Overflow See other posts from Stack Overflow or by mongeta
Published on 2010-06-18T14:19:04Z Indexed on 2010/06/18 14:23 UTC
Read the original article Hit count: 248

Filed under:
|

Hello,

I can't find a way to convert some UTF8 encoding into NSString.

I get some data from a URL, it's a .xml file and here is their content:

<?xml version="1.0" encoding="UTF-8"?>
<person>
<name>Jim Fern&#225;ndez</name>
<phone>555-1234</phone>
</person>

How I can convert the á into a á ?

some code that doesn't work:

    NSString* newStr = [[NSString alloc] initWithData:[NSData dataWithContentsOfURL:URL] encoding:NSUTF8StringEncoding];

© Stack Overflow or respective owner

Related posts about iphone

Related posts about utf-8