tags:

views:

328

answers:

7

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 java. And this is happening, even when no data is copied from Microsoft Word

+1  A: 

Have you seen this?

http://www-01.ibm.com/support/docview.wss?uid=swg21339066

Laplace
I have, but this does not solve my problem
mita
+1  A: 

What the others are saying is that it usually means a problem with encoding. Something somewhere is probably transforming the strings (or forgetting to set the correct encoding where the data is viewed.

Daniel Ribeiro
+2  A: 

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. 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). It is probably some accented character, or a quote like “test” rather than the bland "test".

Gary
A: 

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.

madhumita
A: 

Could the user have pasted a line from MS Word in the jsp field?

Fantabel
A: 

No its not the case.The User is not pasting any this in this particular field

mita
The only reason I want to fix it, as I am saving all the feilds asXML clob, And while parsing, the sax parser is throwing "javax.servlet.ServletException: org.xml.sax.SAXParseException: Invalid byte 1 of 1-byte UTF-8 sequence." exception
mita
A: 

Hi All, I found a solution to this problem, though still not aware of the cause .

*The code which was causing the error:*

if(certHolderLoanNumber == null){

certHolderLoanNumber = "";//we don't want to display "null"

}

%>

  Loan Number: " />

The code which solved the problem:

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. Strange!!

mita
That is odd. As you probably know, ` ` is the html entity representing a space. I don't understand how it could end up that way if the String is being manipulated directly in the core logic of your application. More details would be appreciated.
James P.