Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Replace MS Word Smart Quotes With Straight Quotes

DZone's Guide to

Replace MS Word Smart Quotes With Straight Quotes

·
Free Resource
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.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}