replace MSWord smart quotes in asp.net webform

前端 未结 3 731
醉话见心
醉话见心 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:42

    These smart quotes are a unicode point. All you need is a simple String.Replace to sort them out.

    -edit- Something like:

    mystring.Replace("\u201C","\"").Replace("\u201D","\"")
    

提交回复
热议问题