I´m at the very beginning with Ruby and give again and again this error
program.rb:6:in `gsub': broken utf-8 string (argumenterror)
when I'm trying this short code:
#coding:utf-8
temp=""
txtfile=File.open("8-3_tiedosto.txt","r");txtfile.each{|row|temp=temp+row};txtfile.close
temp = temp.gsub("Å", '')
puts temp
How to fix the code, as my environment does not allow to change the encoding statement at the first line? The original text in the file contains characters that I do not to
include to my final result, that should only contain ASCII 65..90 and
97..122. So I do not understand, what arguments should be given to gsub or how I shoul change my code?
I'm so sorry becaus ogf my stupidity.:$