简体   繁体   English

特殊字符发行-Rails / DB2

[英]Special Character Issue - Rails/DB2

I have a Rails App and users are pasting certain values from MS Word. 我有一个Rails应用程序,用户正在从MS Word中粘贴某些值。

When I pasted this... Paul's “Test2” 当我粘贴此内容时... Paul的“ Test2”

This is what gets rendered in the app... Paul’s “Test†这就是在应用程序中呈现的内容... Paul的“测试”

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.) 鉴于这种情况正在发生,关于如何处理此垃圾的任何建议(我会尝试使用一个简单的gsub,但实际上发现很难看到我要替换的字符实际上是什么。)
  • anyone seen anything like this? 有人看到过这样的东西吗? We're running Rails 2.3 and DB2 9.7 我们正在运行Rails 2.3和DB2 9.7

Thanks 谢谢

These are MS Word "smart quotes". 这些是MS Word“智能引号”。 See How do I convert Word smart quotes and em dashes in a string? 请参阅如何在字符串中转换Word智能引号和破折号?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM