--Try doing this and see if it helps with your substitution experience,
without getting too involved with Ruby's encoding mechanism


#coding:utf-8

## Do NOT delete the above utf-8 line, which
## you already have in your original copy

temp=""
txtfile=File.open("8-3_tiedosto.txt","r")
txtfile.each{|row|temp=temp+row}
txtfile.close

tmp = temp.gsub(/[^A-Z0-9[:punct:]\s]+/ix, '')

puts tmp

PS--I left the numericals and all kinds of punctuational marks in there,
just in case if you have them in the original file--though there are
certainly not within your original range of ASCII 65..90 and 97..122

-- 
Posted via http://www.ruby-forum.com/.