-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate saving single and double quotes as question marks
PostPosted: Wed Jul 04, 2007 10:35 am 
Newbie

Joined: Wed Jul 04, 2007 10:15 am
Posts: 1
I'm having a problem with Hibernate where is saving single and double quotes as question marks. I debug the application and see the string to be saved just before a Hibernate "this.save(content);"

A sample string to be saved is as follows:

Lorem Ipsum 'is simply dummy' text of the "printing" and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,

The string persistences to the database as follows:

Lorem Ipsum ?is simply dummy? text of the ?printing? and typesetting industry. Lorem Ipsum has been the industry?s standard dummy text ever since the 1500s,

I've been using Hibernate for a couple years now and never ran into this before. The database is MySQL 5.* and the data type in the DB is TEXT.

Any suggestions would be greatly appreciated. I feel sure I will be humbled by missing something obvious but cannot think of what that might be at the moment.

Thanks in Advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 04, 2007 12:10 pm 
Newbie

Joined: Thu Nov 02, 2006 11:41 am
Posts: 6
A double quote character in ASCII is 0x22

If you are copying the content from Microsoft Word or other software and pasting it in a HTML form - it will be one of the extended characters.

So, unless your database supports that character type - you will see '?'

When you debug - try displaying the character code of the " or ' character.

System.out.println(((int)"Lorem Ipsum 'is simply dummy' text of the ".toCharArray()[12]));


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.