Squeakあれこれ

Squeak関連情報など

[N7]漢字コード変換

2005-03-24 | squeakあれこれ
Nihongo7リリースおめでとうございます。昨日は飲んで爆睡でした。
日本語版リリース記念と言うわけではないですが、漢字コード変換example。
"Shift-JIS"
| fs |
fs := FileStream readOnlyFileNamed: 'SJIS.txt'.
fs converter: (TextConverter newForEncoding: 'shift-jis'). "from #encodingNames"
(StringHolder new contents:  fs contents) openLabel: 'text'.
fs close.
"UTF-8"
| fs |
fs := FileStream readOnlyFileNamed: 'UTF-8.txt'.
fs converter: (TextConverter newForEncoding: 'utf-8'). "from #encodingNames"
(StringHolder new contents:  fs contents) openLabel: 'text'.
fs close.
"EUC"
| fs |
fs := FileStream readOnlyFileNamed: 'EUC.txt'.
fs converter: (TextConverter newForEncoding: 'euc-jp'). "from #encodingNames"
(StringHolder new contents:  fs contents) openLabel: 'text'.
fs close.

最新の画像もっと見る

2 コメント

コメント日が  古い順  |   新しい順
Unknown (よしき)
2005-03-24 01:20:21
飲んで爆睡だったのはリリースを祝ってくださったからですか?
返信する
Unknown (hkawa90)
2005-03-25 19:58:37
そうです!
返信する