You can use encode for that.
text.encode('UTF-8', :invalid => :replace, :undef => :replace)
Or text.scrub
For more info look into Ruby-Docs, replaces it by default with a question mark box.
You can use encode for that.
text.encode('UTF-8', :invalid => :replace, :undef => :replace)
Or text.scrub
For more info look into Ruby-Docs, replaces it by default with a question mark box.