Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Bonni Garcia   on Oct 03 In Java Category.

  
Question Answered By: Ayaz Hashmi   on Oct 03

you should have this code in your pages :
<head>
<META http-equiv="Content-Language" content="fa">
<META http-equiv="Content-Type" content="text/html;
charset=utf-8">
</head>
and in your MySQl's my.ini file in [mysqld] section ,
you should have :
default-character-set=utf8
or you can set utf8 encoding  in your sql code.
then in your hibernate  configuration file you should
have the properties :
useUnicode=true
characterEncoding=UTF-8
then insert an init param in your web.xml <servlet>
tag

<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>

and save your pages in utf-8  format.
this will work well , but if you have a form that have
file upload and you are using a multipart form , your
unicode data will loose , and you should seperate your
form into two section , in one section get unicode
data and in one section upload your files.

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on JSP & utf-8 Or get search suggestion and latest updates.


Tagged: