开发者

solve copy/paste encoding problems?

I hear that you can copy paste text from MS word and send an email or post something and there will be an encoding problem.

I also heard from someone else its only a problem with webpages that cant handle unicode. Is it possible to have a doc that cannot be copy/paste to a webbrowsers/apps properly? (assuming its all text and only has alignment problems). What can i have in a document that triggers some problems easily fixable by adding more code (such as unicode support).

sidenote my webapps are written in C开发者_开发问答# asp.net


It is very much possible.

When you copy/paste from Word, you can end up in all kinds of ugly situations. Paste it into a rich text editor, and you'll probably end up having some crazy html hidden away, not seen until you view the result. We have been wrestling with this problem a long time at work, and the easiest solution to get right encoding and no extra:

  1. Copy your text
  2. Paste it into notepad/notepad++
  3. Copy the text from there
  4. Paste it!

Hope that helps!


well this is a good segment since i wasted 3 hours of my employer's time until i figured out the root cause of the problem.

scenario: copy text from a PDF file viewer and pasting it as a translation string in a Drupal site. Then write a CSV exporter in PHP and wonder WHY the text is mangled.

Eventualy I had to redo the translation to remove all the "fancy" quotes, accents and wathcamabobers from the dud spud text.

the end face

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜