Created
October 16, 2012 11:14
-
-
Save m-nori/3898718 to your computer and use it in GitHub Desktop.
文字コード指定してのファイル操作
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# utf-8の文字列をsjisで出力 | |
open(output_file, "w+:sjis:utf-8") | |
# sjisのファイルをutf-8とに変換して読み込み | |
open(input_file, "r:sjis:utf-8") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment