The ppsmq program attempts to convert a file with straight quotes into one with curly quotes. It can work with either a plain text file or an HTML file. It only makes changes it's pretty certain are correct. It will flag those it is uncertain about with a "@" character. It will leave alone any straight quotes it can't reliably classify.

Even if you don't intend to convert your book to curly quotes, anything that this program flags is often an error and should be investigated.

If you are converting, once you've run the program and downloaded the result file, search everywhere for "@" and manually enter the correct punctuation, then remove the "@" flag. Then search for straight double quotes (there should be none) and straight single quotes (there usually are some).

If you run this on an HTML file, you will find it converts all single quotes inside HTML tags to "∮" and all double quotes in tags to "∯" to protect them. The process is the same as in the previous paragraph. For HTML, there is an added step to replace all "∮" with single quotes and all "∯" with double quotes to restore the HTML tags.

Please note that all HTML tags must begin and end on a single line for this to work—the beginning < must be in the same row with the >. Otherwise the quote marks will be converted to curly quotes which will cause problems with the HTML.