UTF-8 text : set_encoding « File Directory « Ruby






UTF-8 text


f = File.open("data.txt", "r")   # Open file data.txt for reading
f.set_encoding(Encoding::UTF-8)       # UTF-8 text

 

Related examples in the same category

1.Latin-1, transcoded to UTF-8