From: "R.. Kumar" Date: 2010-06-16T13:31:52+09:00 Subject: Re: gsub: invalid byte sequence in US-ASCII Brian Candler wrote: > > I can only guess that the external encoding picked up from your > platform's environment is US-ASCII (are you using cygwin by any chance?) > > You probably need to set the external encoding to UTF-8 or BINARY for > your regexp not to crash. Try adding -Ku or -Kn to your ruby command > line. Ok, I've got it. The problem occured when the program was run by cron. My user setting is UTF and it ran fine in terminal. So now in the program itself I have set LC_CTYPE and LC_ALL to en_US.UTF-8. Hopefully, it should work fine now. Thanks. -- Posted via http://www.ruby-forum.com/.