by shigemk2

当面は技術的なことしか書かない

2018-12-27から1日間の記事一覧

Pythonのマルチバイト文字列出力のちょっとしたメモ

Emacsのshell-commandで以下のようなPythonワンライナーを実行するとUnicodeEncodeErrorが発生した。 (shell-command-to-string "/usr/local/bin/python2.7 -c \"import sys; sys.stdout.write(u'テスト')\"") "Traceback (most recent call last): File \"<string>\</string>…