Apostrophe corrupted in save to database
843836Jan 25 2005 — edited Jan 25 2005The 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!!