Replace MS Word Smart Quotes With Straight Quotes
Join the DZone community and get the full member experience.Join For Free
MS Word's smart quotes cause all kinds of problems when pasted into web applications as they're none standard characters. In Ruby, the following works, replacing them with ' and " , which can then be turned into the proper entities with textile etc.
string.gsub! "\342\200\230", "'" string.gsub! "\342\200\231", "'" string.gsub! "\342\200\234", '"' string.gsub! "\342\200\235", '"'Perhaps someone can implement this in a nicer way.
Opinions expressed by DZone contributors are their own.