Skip to content

Instantly share code, notes, and snippets.

@igaiga
Created May 31, 2018 07:45
Show Gist options
  • Save igaiga/abb9cfb8237ba6adbd18a4695b6749a5 to your computer and use it in GitHub Desktop.
Save igaiga/abb9cfb8237ba6adbd18a4695b6749a5 to your computer and use it in GitHub Desktop.
# enc_test.txt に 日本語 を1行書いておく
File.open("enc_test.txt") do |f|
puts out_str = f.each_line.first
puts out_str.encoding
end
puts in_str = "中の日本語"
puts in_str.encoding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment