0

I have a Rails App and users are pasting certain values from MS Word.

When I pasted this... Paul’s “Test2”

This is what gets rendered in the app... Paul’s “Testâ€

However, and this is the most bizarre aspect of this - this does not happen at once and I have not been able to track the specific circustances that leads to it.

So a couple of questions:

  • given that this is happening, any suggestion on how to handle the rendering of this junk (I would try a simple gsub but am actually finding it difficult to see what the characters actually are that I'm trying to replace.)
  • anyone seen anything like this? We're running Rails 2.3 and DB2 9.7

Thanks

  • Thanks glenn. yes, that's it. Specifically turns out our DB uses ISO-8859-1 encoding, but on the way out it's getting encoded into UTF-8, which causes the character sequence. Going to do a replace on the way in. – Paul Harvey Aug 23 '10 at 18:08

1 Answers1

0

These are MS Word "smart quotes". See How do I convert Word smart quotes and em dashes in a string?

Community
  • 1
  • 1
glenn jackman
  • 238,783
  • 38
  • 220
  • 352