我正在使用 Facebook 的 Graph API 和 JavaScript SDK 创建一个新专辑。在创建带有描述(消息)和名称的新专辑时,会编码特殊字符。但是,当我尝试对字符进行编码时,一旦创建专辑,它们就不会被解码。有没有其他人遇到过这个问题?
JavaScript
/** Example One: Facebook encodes characters **/
var albumName = "Album Name";
var albumDesc = "Description with áéíóú";
FB.api("/me/albums", "post", {message:albumDesc, name:albumName}, function(res) {
albumID = res.id;
uploadPhotoToAlbum(albumID);
});
/** Example Two: Facebook does not decode characters **/
var albumName = "Album Name";
var albumDesc = "Description with %C3%A1%C3%A9%C3%AD%C3%B3%C3%BA";
FB.api("/me/albums", "post", {message:albumDesc, name:albumName}, function(res) {
albumID = res.id;
uploadPhotoToAlbum(albumID);
});
/** Example Three: Facebook does not decode characters **/
var albumName = "Album Name";
var albumDesc = "Description with áéíóú";
FB.api("/me/albums", "post", {message:albumDesc, name:albumName}, function(res) {
albumID = res.id;
uploadPhotoToAlbum(albumID);
});