From: "Andreas S." Date: 2010-10-12T08:35:54+09:00 Subject: Re: Ruby 1.9.2: How to sanitize text with invalid characters? Scott Gonyea wrote in post #949256: > Will this work? > > blah1 = "#{0xFF.chr} abcde" > blah2 = blah.split(/[^[:print:]]/).join Only if the desired encoding is ASCII. -- Posted via http://www.ruby-forum.com/.