我试图从 XML 中删除 umlaults。我也使用了一些这样的代码,但它仍然无法正常工作,所以请帮助我完成我的任务。
NSString *something = [self base64StringFromData:CDATABlock length:[CDATABlock length]];
NSData *pageData=[something dataUsingEncoding:NSUTF8StringEncoding];
NSString *webpage = [NSString stringWithCString:something encoding:NSUTF8StringEncoding];
NSString *torrent = [NSString stringWithUTF8String:something];
NSString *body = [NSString stringWithCString:[CDATABlock bytes] length:[CDATABlock length] encoding:NSUTF8StringEncoding];
NSData *torrent = [ objectFromEncodedData:CDATABlock];
NSString *secondtry = [NSString stringWithFormat:@"%.*s", [CDATABlock length], [CDATABlock bytes]];
NSString *secondtry = [[NSString alloc] initWithBytes:[CDATABlock bytes]length:[CDATABlock length] encoding: NSUTF8StringEncoding];
NSString *secondtry = [NSString stringWithCString:[CDATABlock bytes] encoding:NSUTF8StringEncoding];
NSString *secondtry = [NSString stringWithUTF8String:[CDATABlock bytes]];
NSString *secondtry = [NSString stringWithCharacters:[CDATABlock bytes] length:[CDATABlock length] / sizeof(unichar)];
实际上从 XML 我得到了这个标签
[CDATA[Dickensstraße, Zoo, Mitte (Stadtbezirk), Hannover, Region Hannover, 30175, Niedersachsen, Deutschland]]
它显示这个标签,所以为什么我在显示中得到错误的字符串。
DickensstraÃe, Zoo, Mitte (Stadtbezirk), Hannover, Region Hannover, 30175, Niedersachsen, Deutschland