Skip to content

Instantly share code, notes, and snippets.

@m-nori
Created October 16, 2012 11:14
Show Gist options
  • Save m-nori/3898718 to your computer and use it in GitHub Desktop.
Save m-nori/3898718 to your computer and use it in GitHub Desktop.
文字コード指定してのファイル操作
# 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