Slide 6
Slide 6 text
IO#set_encoding
#
• #set_encoding
• encoding: ICONV.-"
• invalid: :skip or nil
&)$UTF-8,
• ' /+
File.open("./data.txt") do |file|
# Shift_JIS*0%
# (!0
file.set_ecoding("Shift_JIS", :skip)
end
# File.open
#
File.open("./data.txt", "w"
encoding: "Shift_JIS",
invalid: :skip)
2018/07/18 Crystal.tokyo #7