I have a file that contains \"straight\" (normal, ASCII) quotes, and I\'m trying to convert them to real quotation mark glyphs (“curly” quotes, U+2018 to U+201D). Since the tran
I hate to say it, but the best course of action might be to study what Word does, and copy it. Even if it's wrong in some cases, it represents a standard that many people have become accustomed to. One behavior to emulate is having undo (Ctrl-Z) immediately revert to the straight quote after you have substituted a curved one.
A good place to start would be with a state machine:
You can make additional decisions at each of the state transitions.
You could attempt to normalize the single quotes by identifying known conjunctions, for instance, and converting them to a different, not text, character prior to processing.
My $0.02
Try Shift + Ctrl + " (double quote key), this worked for me on windows 10, using a program called Kalipso.