Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Apostrophe corrupted in save to database

843836Jan 25 2005 — edited Jan 25 2005
The answer to this is on the tip of my brain, but I can't seem to find it.

Im processing a textarea in a web form and saving the result to a text field in MySQL. I am SOMETIMES (but not always...seems to be maybe browser dependent???) running into a problem where an apostrophe is coming out strange in the database. For example...

The word "don't" shows up as "don���t" in the database and "don???t" when reproduced on a jsp page.

I'm using something like this, myTextareaValue.replaceAll("\'", "''"), to convert a single apostrophe into a double (e.g. convert don't into don''t) for the SQL statement, but since it doesn't always get corrupted, I'm not sure that's the problem.

Any ideas??
Thanks!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 22 2005
Added on Jan 25 2005
4 comments
482 views