This is a presentation show as Lightening Talk on PyConJp 2011 in Tokyo, in 27, Aug, 2011 Project pages: http://pypi.python.org/pypi/Unihandecode/0.31 https://launchpad.net/unihandecodeRead less
Pythonは使いやすい覚えやすい気持ちいいとまで言う人もいる。たしかにその通りだと思った。しかし、日本語を使おうとした時に急に気持ち良くなくなる。そう感じたのは僕だけではないはずだ。 ということで今日の日記のネタはPythonと日本語となりました。 (WindowsXPにココから "Python 2.5.1 Windows installer" をインストールした環境でテストしています。) まずは、あなたが書いたコードはutf-8で保存する。そして、そのコードの先頭には以下を記入する。 # -*- coding: utf-8 -*- あなたはエディタに何を使っていますか? 秀丸、メモ帳、vim、meadow、或いは Python Scripter、eclipse ? いずれにしてもファイルを保存する時のエンコードはutf-8にすべし。 では早速気持ちよくない(表示が文字化けする!)例。
という2chのスレがかなり勉強になったのでまとめ。 少しでも有用だと思ったものは載せてあるので結構長いです。 Unicodeのような文字集合(符号化文字集合?)やUTF-8のようなエンコーディング方式に限らず色んな文字コードにまつわる話があります。 たびたび話が繰り替えされますがそれは確認ということで。 (元スレ) 追記:簡単にまとめました。 1 :デフォルトの名無しさん:2007/04/30(月) 20:02:37 ビッグインディアンとかなんとかかんとか 3 :デフォルトの名無しさん:2007/04/30(月) 20:05:48 また、頭の悪そうなスレが・・・ >>1 それは魚とマグロの違いを訊ねるようなもんだ。 4 :デフォルトの名無しさん:2007/04/30(月) 20:06:49 魚と鮪というよりは、魚と刺身の違いのような気がする。 5 :デフォルトの名無しさん:2007/04/
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く