macでshift_jis , euc-jp 変換 iconv

ちょっと面倒だからShift_JISは無視してたけど必要なのでとりあえず。
nkf は入っていなかったので iconvで変換

$ which nkf
$ which iconv
/opt/local/bin/iconv
iconv -f UTF-8 -t Shift_JIS utf-8.txt > sjis.txt

メッセージファイルをsjisで保存しておいて使う。

var msg ={
menu:{
100: “メニュー”,
101: “ランチ”,
102: “ハンバーグ”
},
error:{
9001: “在庫がありません”,
9002: “待ち時間30分です。”
}
};

を保存しておいてsjisのページで読込んで使えました。

This entry was posted on 日曜日, 4月 15th, 2012 at 4:15 PM and is filed under Javascript, Mac. 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アプリ開発
お気軽にお問い合わせください
大崎・五反田近郊での対面でのお打ち合わせはいつでも可能です。