From: Levin Alexander Date: 2006-01-23T08:11:11+09:00 Subject: Re: remove non-ASCII characters in a string On 1/22/06, ruby talk wrote:> What is considered an ascii char? i used the> http://www.lookuptables.com/ chart from ! to ~ or 33 .. 127 I use everything <127 because I want to preserve tabs and linebreaks > def remove_nonascii(replacement) This does not work if the source text is UTF-8 encoded. On my machine: str = "旦" #=> "\303\266" str.remove_nonascii #=> "??" -Levin