On Thu, Nov 10, 2011 at 9:03 AM, Ar Ik <arsi.ikonen / gmail.com> wrote: > Not possile to edit previous, so additional comment: My environment do > not allow to change character statement at the first line... If you insert this line at the beginning of the script, what does it print? p("".encoding) Btw, you can simplify reading by doing txtfile = File.read("8-3_tiedosto.txt", encoding: 'UTF-8') assuming your file is encoded in UTF-8. You might have to play with Encoding.default_external= Encoding.default_internal= For more please see http://blog.grayproductions.net/articles/miscellaneous_m17n_details Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/