I have a webservice with diferent changes for the DataBase. When I consume the webservice return lines with sql tags, like this:
<sql>
DELETE FROM TABLE WHERE ...
</sql>
<sql>
INSERT INTO TABLE WHERE ...
</sql>
<sql>
UPDATE TABLE SET ... WHERE ...
</sql>
I save this codes in the NSMutableArray like this:
-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {
if ([elementName isEqualToString:@"sql"]){
[maResultado addObject:[NSMutableString stringWithFormat:@"%@", ResultadoSoap]];
[ResultadoSoap setString:@""];
}
}
This is good, but if the webservice returns a word with an accent (accent because is in spanish), the app only get the phrase after the accent.
Example:
the web service return this:
<sql>
INSERT INTO DATOS(datos, fecha) VALUES('Indagar si el médico a tenido oportunidad de ...', '20/02/2013')
</sql>
I do this:
if ([elementName isEqualToString:@"sql"]){
[maResultado addObject:[NSMutableString stringWithFormat:@"%@", ResultadoSoap]];
[ResultadoSoap setString:@""];
}
and in the maResultado in the objectatindex only have this:
édico a tenido oportunidad de ...', '20/02/2013')
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…