2010年05月05日 22:37 カテゴリPython Pythonで日本語文字列 (UnicodeとUTF-8, Shift-JIS, EUC-JPなどの相互変換) Posted by yawamen No Trackbacks Tweet ※2.*系の話です.3.*系は違うので注意. Pythonで日本語を扱う場合,UTF-8やShift-JIS, EUC-JPなどの各種文字コードが使えますが, これらとは別にPythonにはUnicode文字列というものが存在します. ※PythonではUTF-8とUnicodeは別物です. 詳しくはマニュアルを読んで頂くとして,ここではソースコードの書き方やいろいろな変換について紹介します. 【ソースコード中に日本語を書くために】 まず最初に,基本的なこととして,何も考えずにソースコード中に日本語文字を書いてしまうと次のようなエラーが出る場合があ