replace MSWord smart quotes in asp.net webform

前端 未结 3 672
醉话见心
醉话见心 2021-01-29 00:28

I am having a problem where users are composing some large chunks of text in MS Word, then pasting that in to the online form. These get entered into the DB as an upside down ?

3条回答
  •  北恋
    北恋 (楼主)
    2021-01-29 00:45

    You should run the input through the HtmlEncode method, which will convert from “ or ” to and , allowing you to save those and other higher characters to a format that can be saved without hassle.

    Should I also mention Joel's post again?

    The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)

提交回复
热议问题