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