Your first argument to gsub appears to be ASCII 197. On Wed, Nov 9, 2011 at 12:35 PM, Ar Ik <arsi.ikonen / gmail.com> wrote: > I 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 > > 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? > > I'm sorry because of my stupidity :) > > -- > Posted via http://www.ruby-forum.com/. > -- Carina