opensocial persistent API | mixi

http://developer.mixi.co.jp/appli/spec/pc/share_info/

mixiアプリでデータ保存を利用したいときに、 JSONや日本語を入れる時の注意点。
まず日本語もJSONデータにする。データが大きくなるのでサイズを計算しましょう。
エスケープされて 1 文字 6 バイト消費します。

JSON.stringifyでjson化して保存した後読み出すとき、parseする前にunescapeする必要があります。
html entityがエスケープされて保存されています。

{"u":"1318900612392"}

こんな感じで。
なので、

JSON.parse(gadgets.util.unescapeString(data));

のようにunescapeStringを利用してからparse。

This entry was posted on 火曜日, 10月 18th, 2011 at 10:34 AM and is filed under mixi. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Unityによるゲームを公開しております iOS/Android
https://itunes.apple.com/jp/app/lost-knight-3d-action/id900917032
https://play.google.com/store/apps/details?id=com.groundroad.runknight

各種開発支援・機能開発等小さいお仕事などもお請けしております。
unity開発支援, PHPシステム開発, javascript/html5 フロント開発, titanium mobileアプリ開発
お気軽にお問い合わせください
大崎・五反田近郊での対面でのお打ち合わせはいつでも可能です。