Over a million developers have joined DZone.

Replace MS Word Smart Quotes With Straight Quotes

·
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. 
Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}