我的 XML 文件有中文字符,它们是 Big-5,如何根据下面的代码将其转换为 UTF-8?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSString *xmlFilepath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Hostels.xml"];
NSData *xml = [[NSData alloc] initWithContentsOfFile:xmlFilepath];
NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData:xml];
Parser *theParser = [[Parser alloc] initParser];
[xmlParser setDelegate:theParser];
.......