0

In my app I do an xmlparser but I have a problem during parser because in a tag I have a special letter "รจ" and it read it as "\U00e8"; and it close a tag of my xml...and I have an error in my parsing...

I set my path in utf-8 in this way

NSString *path = @"emaple.com";

NSError *error;
NSURL *url      = [NSURL URLWithString:path];
NSString * dataString = [[NSString alloc] initWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error];
NSData *data = [dataString dataUsingEncoding:NSUTF8StringEncoding];

affayfeed = [[NSMutableArray alloc]init];
parser = [[NSXMLParser alloc] initWithData:data];

but I have the same problem...why?

cyclingIsBetter
  • 17,447
  • 50
  • 156
  • 241
  • In your `foundCharacters` method are you using `[NSMutableString appendString:]` to piece together your character stream? โ€“ joverboard Jun 21 '12 at 15:43
  • Are you certain that all your encoding matches up? Generally, the escaped unicode characters are adapted automatically. โ€“ joverboard Jun 21 '12 at 16:22
  • Your xml file should begin with a line similar to ``. Make sure that is actually UTF-8. If the file is properly encoded, it should be able to just read it in as it's written. โ€“ joverboard Jun 21 '12 at 16:44

0 Answers0