View Full Version : How to avoid unwanted character while stored in DB

20 Jan 2011, 5:14 AM
To send a mail content i'm using ExtJS-html editor. I try to store the content to database. but its stored with garbage values (like ?) . How to avoid the garbage vaule?????


Original content: Above every month or a quarter there will be a comparison with the previous years month.

DB content : Above every month or a quarter there will be a comparison with the previous year?s month.

20 Jan 2011, 5:20 AM
are you HTML encoding your content?

20 Jan 2011, 5:45 AM
and AFTER encoding content (like Jay told before) have you tried tosomehow "work" a little on your content, on the server side BEFORE inserting into database ?
With some function that escape quotes, and/or escape special chars ? for php, for example, try to see arround string functions :
htmlspecialchars, htmlentities, etc...

9 Feb 2011, 4:08 AM
i did it based on your suggestions. But it showing same error.. Please Help me on that.

9 Feb 2011, 4:14 AM
sorry, i don't know more than this :-( :-)
for sure you must try between these string functions. Some encoding, deconding, your db encoding in the db engine, etc. The solution must be 100% somewhere there. Don't ask me which one... :-) One of them for sure ! Good Luck !

9 Feb 2011, 4:33 AM
I had the same problem, all I did was replaced special characters with there html equivelent. This is by any means the best approach. I think I used a replace() function.

9 Feb 2011, 4:37 AM
with MANUALLY replace of some codes, you will have only a LIMITED number of replaces. Try to use a generic one, for having ALL the replaces... i think...