How should I do to decode % escaped japanese string in Objective-C

eedarous

New Member
I want to decode % escaped string like below.\[code\]%E7%89%9B%E4%B9%B3%E3%81%8C%E7%BE%8E%E5\[/code\]Through Web API, I get xml data that includes japanese string. This app received with NSURLConnection. So the data was received below method.\[code\]- (void)connectionDidFinishLoading:(NSURLConnection *)connection{ NSString *xml = [[NSString alloc] initWithData:receivedData encoding:encoding]; NSData *xmlData = http://stackoverflow.com/questions/11329752/[[xml stringByReplacingPercentEscapesUsingEncoding:encoding] dataUsingEncoding:encoding]; NSXMLParser *parser = [[NSXMLParser alloc] initWithData:xmlData]; [parser setDelegate:self]; [parser parse];}\[/code\]However, this xmlData has only english alphabet strings not japanese escaped strings. So I cannot get japanese strings data from xmlData. By all rights, this xmlData should be\[code\]<?xml version="1.0" encoding="UTF-8" ?><ResultSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:jp:jlp" xsi:schemaLocation="urn:yahoo:jp:jlp http://jlp.yahooapis.jp/MAService/V1/parseResponse.xsd"><ma_result><total_count>3</total_count><filtered_count>3</filtered_count><word_list><word><surface>
 
Back
Top