是什么导致带有 ¿ 的文本字段损坏?人物?
我们的应用程序中有一个非常奇怪的问题,突然我们开始注意到 颠倒的问号与输入到屏幕字段中的其他文本一起保存。这些倒置的问号最初并不是用户输入的,也不清楚它们来自哪里。我们使用 Oracle 10g 和 Asp.Net。
以下是该问题的示例:“140, 141) ¿ 16-Oct-07”。如果有人以前见过这个问题并找到了解决这个问题的方法,请告诉我如何做。
We have a very strange problem in out application, all of a sudden we started noticing
upside down question marks being saved along with other text typed in to the fields on the screen. These upside down question marks were not originally entered by the users and it is unclear where they come from. We are using Oracle 10g with Asp.Net.
Here is an example of the issue: "140, 141) ¿ 16-Oct-07". If any one have seen this before and found a way to fix this please let me know how.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这听起来像是字符编码问题。请检查您的数据库(表)设置的编码,以及在数据库中传递数据的对象或字符串的编码。如果存在不匹配(ANSI 中的 DB,UTF-8 中的 App),可能会出现此类问题。
This sounds like a character encoding issue. Please check what encoding your database (tables) are set to, and what encoding the objects or strings which are passing data in the database are of. If there is a mis-match (DB in ANSI, App in UTF-8), these sorts of issues can appear.
Greg,您应该检查 NLS_CHARACTERSET 而不是 NLS_NCHAR_CHARACTERSET 设置。我敢打赌,它是 WE8ISO8859P1 或类似的东西,而不是 unicode。当以 unicode(可能是 UTF8)提交的数据并且 Oracle 尝试将字符映射到 WE8ISO8859P1 字符集时,就会出现此问题。它对大多数字符来说都很好,但对于高 ASCII 数字字符(例如 140)则失败。
所以,是的,我在我们的应用程序中看到了同样的问题,在我们的例子中,它是由特殊引号(“example”、“example”)引起的是从 MS Word 复制的。 Word 会自动将双引号转换为其他引号。解决方案是将数据库转换为 UTF-8。
Greg, you should check NLS_CHARACTERSET not NLS_NCHAR_CHARACTERSET settings. And I bet you it's WE8ISO8859P1 or something similar and not unicode. The problem occurs when the submitted data in unicode, which is probably UTF8, and Oracle tries to map the characters to WE8ISO8859P1 character set. It does fine for most of them but fails for high ASCII number characters, like 140.
So yes, I have seen the same issue in our application and in our case it was caused by special quote marks (“example”, ‘example’) that were copied from MS Word. Word automatically converts double quotes to some other quotes. The solution was to convert the database to UTF-8.
如果您的用户从 MS Word 进行复制,您可以关闭该功能。它是自动更正/自动格式功能的一部分。如果取消选中引号和撇号的替换选项,应该没问题。确保在键入时关闭“自动套用格式”和“自动套用格式”中的替换。
IF your users are copying from MS Word you can turn the feature off . Its part of the autocorrect/autoformat functionality. If you uncheck the replace options for quotes and apostrophes you should be ok. Be sure turn off the replacements in both the AutoFormat and AutoFormat as you type.