紹介マニアMoinMoin

概要

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.3 (CJK/SJIS) (#51, Feb 13 2004, 22:04:56) [MSC v.1200 32 bit (Intel)]'

日本語の表示

これはSJISに関しては可能。

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 "ソソソ"
  File "<stdin>", line 1
    print "ソソソ"
                 ^
SyntaxError: EOL while scanning single-quoted string

参考サイト

http://tech.firebird.gr.jp/firebird/index.php?firebird_xsite=45

http://ash.jp/code/index.htm


CategoryPython

紹介マニアMoinMoin: CJKPython (last edited 2004-08-11 08:48:03 by )