How do I convert Word smart quotes and em dashes in a string?
问题 I have a form with a textarea. Users enter a block of text which is stored in a database. Occasionally a user will paste text from Word containing smart quotes or emdashes. Those characters appear in the database as: –, ’, “ ,†What function should I call on the input string to convert smart quotes to regular quotes and emdashes to regular dashes ? I am working in PHP. Update: Thanks for all of the great responses so far. The page on Joel's site about encodings is very informative: