From: Marcelo Cavaco Date: 2010-01-14T21:50:12+09:00 Subject: how change encoding? hi everybody, please help... i have a file (Documentação.txt) with this structure: my_data << [0, "Ação", Zlib::Deflate.deflate("Sample Text!!!")].to_a my_data << [0, "Test", Zlib::Deflate.deflate("Only ASCII chars!!!")].to_a my_data << [0, "Test char Á", Zlib::Deflate.deflate("New test (Á)")].to_a OBS: i not create this file!!! and i have this code: require 'fileutils' require 'zlib' DestFile = "D:\\temp\\app\\Documentação.txt" my_read_data = File.open(DestFile, 'rb') { |f| Marshal.load f } my_read_data.each do |item| file_path = "D:\\temp\\app\\new_files_" + item[1] + ".txt" file_text = Zlib::Inflate.inflate(item[2]) File.open(file_path, 'wb') { |file| file.write(file_text) } end the result is new_files_AþÒo.txt new_files_Test.txt new_files_Test char ┴.txt and not new_files_Ação.txt new_files_Test.txt new_files_Test char Á.txt why this occurs? is the encode??? how change ? OBS: i do not create the file Documentação.txt. i only read it. PS. be patient. i'm "very" newbiee in ruby.