How to remove all non - ASCII characters from a string in Ruby
问题 I seems to be a very simple and much needed method. I need to remove all non ASCII characters from a string. e.g © etc. See the following example. #coding: utf-8 s = " Hello this a mixed string © that I made." puts s.encoding puts s.encode output: UTF-8 Hello this a mixed str ing ┬⌐ that I made. When I feed this to Watir, it produces following error:incompatible character encodings: UTF-8 and ASCII-8BIT So my problem is that I want to get rid of all non ASCII characters before using it. I