2011-08-24 63 views
1

我正在使用facebook iOS SDK,並且在圖形API中不斷獲取「\ U9ec3 \ U6de8 \ U5a77」等數據字符串。怎麼了?這是我使用的代碼:Facebook iOS SDK和unicode

- (void)request:(FBRequest *)request didLoad:(id)result{ 
    NSLog(@"%@",[result description]); 
} 


- (void)requestFeed:(NSString *)path withDelegate:(id)delegate{ 
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat: @"https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=%@&client_secret=%@",APP_ID,APP_SECRET]]]; 

    NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; 

    NSString *access_token = [[[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding] substringFromIndex:13]; 

    NSLog(@"%@",access_token); 

    [fb requestWithGraphPath:path andParams:[NSMutableDictionary dictionaryWithObjectsAndKeys:access_token,@"access_token", nil] andDelegate:delegate]; 
} 

回答

1

你的字符串'\u9ec3\u6de8\u5a77'相當於'黃淨婷'

這似乎是中文的someone's name。根據谷歌翻譯,它被用普通話讀作「HuángJìng-tíng」。