How do I convert Word smart quotes and em dashes in a string?

前端 未结 13 1767
星月不相逢
星月不相逢 2020-11-29 03:11

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 em

13条回答
  •  旧时难觅i
    2020-11-29 03:36

    In my experience, it's easier to just accept the smart quotes and make sure you're using the same encoding everywhere. To start, add this to your form tag: accept-charset="utf-8"

提交回复
热议问题