2011-09-22 2 views
0

Dans mon ifone App, j'ai appelé une page php pour obtenir le contenu, il renvoie le format JSON, mais la réponse contient des entités Html comme " .Comment je convertis ces entités en unicode.Toutes les méthodes ou bibliothèques dans l'objectifHtml entités forment JSON

aide est très appréciée, Shihab.

Répondre

2

Pour votre problème, vous pouvez utiliser la classe SBJSON et obtiendrez le résultat dans le JSON dictionnaire par le code suivant

NSString *stringResponse = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding]; 
SBJSON *jsonParser = [SBJSON new]; 
NSMutableDictionary *json = [jsonParser objectWithString:stringResponse error:NULL]; 
+0

merci pour ur réponse immédiate, j'ai utilisé les mêmes, mais les entités html est il – vks

+0

NSString * json_string = [[NSString alloc] initWithData: encodage de réponse: NSUTF8StringEncoding]; \t \t \t NSDictionary * object = [analyseur objetWithString: erreur json_string: nil]; \t results = [parser objectWithString: json_string error: nil]; – vks