-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Apostrophe (') becomes upside down question mark (¿)
PostPosted: Thu Feb 03, 2011 4:20 pm 
Beginner
Beginner

Joined: Mon May 10, 2010 2:00 pm
Posts: 22
I've been noticing records with upside down question marks (¿) in our database lately. At first I thought this was a bad translation between the browser and Microsoft Word, but recently I've discovered that this is not the case.

Someone manually entered a comment with apostrophes. When the record is looked up in the database they have been replaced by ¿.

What can I do to prevent this issue?

Thanks


Top
 Profile  
 
 Post subject: Re: Apostrophe (') becomes upside down question mark (¿)
PostPosted: Wed Mar 02, 2011 11:46 am 
Beginner
Beginner

Joined: Mon May 10, 2010 2:00 pm
Posts: 22
bumping this topic since I have not received a response and have not found a solution.


Top
 Profile  
 
 Post subject: Re: Apostrophe (') becomes upside down question mark (¿)
PostPosted: Wed Mar 02, 2011 1:03 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
It seems like an issue with using non-compatible character sets somewhere. How to fix this depends on which database and jdbc driver you are using and possible also what kind of application you are using. Eg. webapps need to set the correct character set in the http response or inside the html document.


Top
 Profile  
 
 Post subject: Re: Apostrophe (') becomes upside down question mark (¿)
PostPosted: Wed Mar 02, 2011 4:51 pm 
Beginner
Beginner

Joined: Fri Apr 28, 2006 7:48 am
Posts: 20
Hi,

I tried putting an Apostrophe and it seems to be working well. Would really appreciate if you could put some sample code and your hibernate.cfg and .hbm files. Also, kindly put the text that you are trying to insert in the database.


Top
 Profile  
 
 Post subject: Re: Apostrophe (') becomes upside down question mark (¿)
PostPosted: Thu Mar 10, 2011 9:59 am 
Beginner
Beginner

Joined: Mon May 10, 2010 2:00 pm
Posts: 22
I believe nordborg is on the right track with the issue.

I tested out this theory. I created a sentence like this in Microsoft Word (2007):

"Here's a line of text. It's got a few things in it to make it act super-crazy when I post."

I copied and pasted this into the website. Throughout all of the webpages that display this text, the text was displayed appropriately. However, when I posted the data to the database the apostrophes where converted into the upside down question marks.

I then copied and pasted the line of text from Microsoft Word to UltraEdit (text editor). Then I copied the text from UltraEdit and pasted into the website. Again, all of the web pages displayed the text correctly. This time when I posted the text to the database, the text also SAVED CORRECTLY.

I think this is a good confirmation that there is something going on with the character encoding. The plan is to re-encode the text before it gets posted to the database. This should resolve the issue. I'll try to remember to post back on here with the results. If I don't get back you can probably assume that it worked.

Thank you for your help and suggestions


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.