I have a Ruby CGI (not rails) that picks photos and captions from a web form. My users are very keen on using smart quotes and ligatures, they are pasting from other sources
class String def strip_control_characters self.chars.reject { |char| char.ascii_only? and (char.ord < 32 or char.ord == 127) }.join end end