简体   繁体   English

颠倒的问号问题

[英]Upside down question mark issue

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. 我们在out应用程序中遇到一个非常奇怪的问题,突然我们开始注意到上下颠倒的问号与其他输入到屏幕上的文本一起被保存。 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 java. 我们将Oracle 10g与Java一起使用。 And this is happening, even when no data is copied from Microsoft Word 即使没有从Microsoft Word复制任何数据,这种情况也在发生

The upside-down question mark is often used when the character stored cannot be rendered by the client. 当客户无法呈现所存储的字符时,通常使用上下颠倒的问号。 So often the data in the database is fine, it is a restriction in the client. 因此,数据库中的数据通常很好,这是客户端的限制。

My first step would be to use the DUMP function to identify the bytes. 我的第一步是使用DUMP函数来识别字节。 As a first step, I'd strip out common 'known valid' characters (alphanumerics and space) 第一步,我要去除常见的“已知有效”字符(字母数字和空格)

select DUMP(translate(upper(col),'~ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 .,','~'),16) dmp,
       translate(upper(col),'~ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 .,','~') val
from ...
where translate(upper(col),'~ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 .,','~') is not null;

Then I concentrator on what is left. 然后我集中精力还剩下什么。 Normally there's a bunch of rare, but acceptable, punctuation (point, comma, hyphen, apostrophe etc). 通常情况下,有一堆罕见但可接受的标点符号(点,逗号,连字符,撇号等)。 I exclude them one by one. 我一一排除。

Anything I can't exclude I'll research (ie google those bytes, which is why I use the '16' option with DUMP, to get them in hex). 我无法排除的所有问题都会进行研究(例如,用谷歌搜索这些字节,这就是为什么我对DUMP使用'16'选项以使其为十六进制的原因)。 It is probably some accented character, or a quote like “test” rather than the bland "test". 它可能是带有重音符号的字符,或者像“测试”这样的引用,而不是平淡的“测试”。

用户可以在jsp字段中粘贴MS Word中的一行吗?

Thanks all for your response. 感谢大家的回应。 Some how there is this particular text field in the jsp for which this is happening.And it is saving this weird character in that column in the table when there is no data for this field.Data is also not rendering properly in the database.And the weird part is, this is not even happening with every record as I could not replicate. 在jsp中有一个特定的文本字段正在发生这种情况,并且在没有该字段的数据的情况下将奇怪的字符保存在表的该列中,并且数据也无法在数据库中正确呈现。奇怪的是,由于我无法复制,这甚至没有在所有记录中发生。

I found a solution to this problem, though still not aware of the cause . 尽管仍然不知道原因,但我找到了解决此问题的方法。

****The code which was causing the error:**** ****导致错误的代码:****

if(certHolderLoanNumber == null){ if(certHolderLoanNumber == null){

certHolderLoanNumber = "";//we don't want to display "null" certHolderLoanNumber =“”; //我们不想显示“ null”

} }

%> %>

Loan Number: " /> 贷款编号:“ />

The code which solved the problem: 解决问题的代码:

certHolderLoanNumber = certificateHolder.getCertHolderLoanNumber(); certHolderLoanNumber = certificateHolder.getCertHolderLoanNumber();

Loan Number: " /> 贷款编号:“ />

Previously when the certHolderLoanNumber field was explicitly set to "" , the value retrieved as per seen by running the debugger was "&nbsp".And when this value was further saved into the database the upside down questions mark was appearing in the xml clob.The GenUtils.nonnull also returns empty String, but this time no upside down question mark appeared. 以前,当certHolderLoanNumber字段显式设置为“”时,通过运行调试器看到的值是“&nbsp”。当此值进一步保存到数据库中时,xml clob中将出现上下颠倒的问号。 GenUtils.nonnull也返回空字符串,但是这次没有出现上下颠倒的问号。 Strange!! 奇怪!!

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

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