Storing and displaying of hindi records using JSP nad MySQL
843840Mar 5 2010 — edited Jun 28 2010I have created a table named 'hindi' like this.
CREATE TABLE `hindi` (
`data` varchar(1000) character set utf8 collate utf8_bin default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
I have a js library which converts text inside a textarea into Hindi while typing.
I am getting the record in servlet using request.getParameter and simply saving it like
INSERT INTO `hindi` VALUES (?);
After saving कैसे हो if I am trying to see it from mysql using select * from... it is displaying
��स� ह�
I tried to fetch the records like this
SET NAMES utf8;
select * from hindi;
and in java code i am doing rs.getString and displaying
But what it is displaying is something like this in the browser
��स� ह�
I have set my content type to this "text/html; charset=utf8"
Can anyone help me in that? I am kind of stuck.
Please dont tell me to use google transliteration.
Thanks in advance. :)