Copying text from Word to textarea

前端 未结 1 802
盖世英雄少女心
盖世英雄少女心 2021-01-24 16:37

A well-known problem: When copying text fro MS Word into a textarea, the text\'s characters get converted to strange characters when saving it to database.

I was wonderi

相关标签:
1条回答
  • 2021-01-24 17:05

    The solution:

    1. Character encoding of the HTML document that holds the form

    This does normally 1 work. If it does not work, your applpication is broken or the browser is broken or the clipboard is broken or MSWord is broken.

    In any case, you can not fix MSWord nor the Clipboard, nor the browser server-side.

    Instead ensure that the encoding the website is using can deal with the characters from the clipboard, and honor the encoding requests into your application have when you process input data.

    1 Please see Handling character encodings in HTML and CSS how it works.

    0 讨论(0)
提交回复
热议问题