2012-05-30 144 views
1

我正在查询传回JSON数据的外部服务。我想将这些数据格式化为二进制PList,将其发送给客户端。我如何在Rails中进行转换?这是一个复杂的数据结构,其中包含数组&散列以及字符串&整数。如何将JSON数据转换为Rails中的PList数据?

基础上的评论,我想这一点:

def friends_facebook 
    @graph = Koala::Facebook::GraphAPI.new(current_user.facebook_token.token) 
    render :plist => JSON.parse(@graph.get_connections("me", "friends").to_json) 
end 

导致错误(在渲染线):

incompatible encoding regexp match (ASCII-8BIT regexp with UTF-8 string) 

回答