我正在解析http://maps.google.com/maps/geo?q=48.209946,11.539421&output=csv。回复是 200,8,“Lerchenstraße 66, 80995 Munich, Germany”。我只显示 CityName,即“Lerchenstraße 66”。但问题是 CityName 字符串包含 Unicode 字符,并且在视图中显示为“Lerchenstra\U00dfe66”。输出应类似于“Lerchenstrasse”或“Lerchenstraße”。
-(void) httpDataDidFinishLoadingWithData:(NSData *)theData {
m_activityLoaded=NO;
temp=[[NSString alloc] initWithData:[dataLoader httpData] encoding:NSUTF8StringEncoding];
NSArray *listItems = [temp componentsSeparatedByString:@","];
NSArray *tempCountryArray = [[listItems objectAtIndex:[listItems count]-3] componentsSeparatedByString:@"\""];
NSString *string = [NSString stringWithFormat:@"%@", tempCountryArray];
NSString *strTe=[[[[string
stringByReplacingOccurrencesOfString:@"(" withString:@""]
stringByReplacingOccurrencesOfString:@")" withString:@""]
stringByReplacingOccurrencesOfString:@" " withString:@""]
stringByReplacingOccurrencesOfString:@"\"" withString:@"" ];
self.cityNameString = strTe;
NSLog(@"CITY NAME IS : %@", strTe);
}
请帮我。提前致谢。