From: Dave Burt Date: 2006-01-25T00:46:11+09:00 Subject: Re: remove non-ASCII characters in a string ruby talk wrote: > What is considered an ascii char? i used the > http://www.lookuptables.com/ chart from ! to ~ or 33 .. 127 Your range excludes ASCII character 32, space. " ".remove_nonascii("?") #=> "?" You also likely want to include characters like tabs and newlines, which are in the 0-31 control range. Levin's original version treats the original text as UTF-8. Is that part of the requirements? My version might look like this: NON_ASCII = /[\x80-\xff]/ "I�t�rn�ti�n�liz�ti�n".gsub(NON_ASCII, "?") #=> "I?t?rn?ti?n?liz?ti?n" Cheers, Dave