views:

174

answers:

4

hello,

in my web site, using google language api , i type malayalam language in text box and text area ,

ഇതു ഒരു നല്ല സിനിമ ആണ്

like this, but when i look in to the mySQL database, in the table, it is

    ഇതു ഒരു 
നല്ല സിനിമ 
ആണ്

and there is no problem for viewing it back in my website, but i use this same table data for my desktop application and in that application when fetching data from db, it shows as ഇതു ഒരു നല്ല സിനിമ ആണ്
not in my native language, if i do a manual update using sql query to the database, then in both website and in my desktop application it is shown correctly in my local language, my web server is tomcat. and my db is mySQL db and db is utf enabled.

what should i do in my java application to save direclty in local language other than സ ..etc.

A: 

Stop HTML escaping your data. But do continue to database-escape it.

tpdi
A: 

Something in your website code may well be HTML encoding the characters before storing them in the database.

Have a look at exactly how your strings are represented just before the database insert/update. If necessary, HTMLDecode the data before inserting into the DB.

Eric J.
+1  A: 

You need to make sure that your web page is encoded in UTF-8, and declared so in the Content-Type HTTP header. Otherwise, the web browser may choose to send HTML-escaped characters when characters outside the presumed page encoding are entered.

Martin v. Löwis
Most people aren't aware of this, but it's true. It's one of the most bonkers things that browsers do.
Laurence Gonsalves
A: 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;

Mallu ഇതു ഒരു നല്ല സിനിമ ആണ്

Madhu