I'm using NSXMLParse to parse my file.xml. It does work, but when I extract the inside text this file.xml, some words are cutted and I suppose that is an encoding problem.
For example, a little part of my file.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<book>
<titulo>Síndrome de Tietê</titulo>
<pagina numero="1">
<linha numero="1">A luz forte do sol lá fora fazia um grande contraste com o escuro do cômodo.</linha>
<linha numero="2">Poucas pessoas. Móveis rústicos e panelas penduradas, com teias de aranha. Gente magra.</linha>
</pagina>
</book>
So, when I parse and extract the '', the content is: 'á fora fazia um grande contraste com o escuro do cômodo'
INSTEAD OF 'A luz forte do sol lá fora fazia um grande contraste com o escuro do cômodo'
I don't know why, but it's cutting the phrase when appears such word 'á'. It's happening with all tags, always that there's something inside like this 'á,ó,ô,é...'
For this reason, I'm wondering if have to do with 'enconding' from my XML file.
My code for load my XML file:
-(id)loadXMLByURL:(NSString *)fileName:(NSString *)extName {
NSString *xmlFilePath = [[NSBundle mainBundle] pathForResource:fileName ofType:extName];
NSData *xmlData = [NSData dataWithContentsOfFile:xmlFilePath];
xmlParser = [[NSXMLParser alloc] initWithData:xmlData];
xmlParser.delegate = self;
[xmlParser parse];
return self;
}
Calling above function:
xmlCon = [[XMLControl alloc] loadXMLByURL:@"geracao":@"xml"];
Any ideas?