Skip to content

Instantly share code, notes, and snippets.

@silverwindzack
silverwindzack / replaceWordChars
Last active March 7, 2017 09:52
Replacement of Fancy MS WORD Chracters
function replaceWordChars(text) {
var s = text;
if(s != null && s.length > 0) {
// smart single quotes and apostrophe
s = s.replace(/[\u2018\u2019\u201A]/g, "\'");
// smart double quotes
s = s.replace(/[\u201C\u201D\u201E]/g, "\"");
// ellipsis
s = s.replace(/\u2026/g, "...");
// dashes