CJKPython
概要
URL
http://cjkpython.i18n.org/index.html#CJKPython
http://mail.python.org/pipermail/python-announce-list/2004-February/002887.html
インストール
設定
利用方法
検証
とりあえず日本語に関してのみ調査。
sys.version
>>> sys.version
'2.3.4 (CJK/SJIS) (#53, May 27 2004, 05:49:12) [MSC v.1200 32 bit (Intel)]'
日本語の表示
これはSJISに関しては可能。DOSプロンプトで日本語が使用できます。
>>> print "そそそ"
そそそ
defaultencoding
>>> import sys
>>> print sys.getdefaultencoding()
cp932
ロケールを自動認識しているのかは未確認。
以下を参考にロケール変更してみた。
http://mlang1.osaka-gaidai.ac.jp/~tagengo/multi/win2k.html
変化しない。再起動が必要なのかな?それともインストール時のロケールで決まるのか?
>>> import locale
>>> print locale.getdefaultlocale()
('ja_JP', 'cp932')
>>> print locale.getlocale()
(None, None)
ロケール変更してもcp932なのは何がおかしいのだろうか?確認方法にミスがある?それともこういう物だっけ?
>>> print locale.getdefaultlocale()
('en_GB', 'cp932')
>>> print locale.getdefaultlocale()
('de_CH', 'cp932')
>>> print locale.getdefaultlocale()
('fr_FR', 'cp932')
>>> print locale.getdefaultlocale()
('ms_BN', 'cp932')
こういう物らしい。
韓国語、中国語がインストールされていないので、他の言語ではどうなるのか未確認。
== 下位バイトが"\(=0x5c)である文字 == CJKPython 2.3.4 ではこの問題は発生しない。
>>> print "ソソソ"
ソソソ
結論
基本的に日本語はPyJUGで配布されている物とそれほど差があるわけではない。Codecが異なる事で変換が異なる可能性はある。
参考サイト
http://tech.firebird.gr.jp/firebird/index.php?firebird_xsite=45
