Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Can i save "தமிழ்" in Database assuch  RSS feed

 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In my application i am entering a Tamil charater as "தமிழ்" and in debug mode i can see the variable some thing as "&#2224 &#2224 &#2224 &#2224 " and when it saves in Database it saves in the same format. However when it displays again browser it displays correctly in Tamil as "தமிழ்".

However they wants that to be saved in the database as exactly what we entered in Tamil "தமிழ்". can we store the exact Tamil character as such in database like this "தமிழ்"..

My JSP pages has a page encoding as UTF-8 and with valid META Tag. Also in my server i am setting request content type as UTF-8

<%@ page language="java" import="com.obopay.wap.common.*" pageEncoding="UTF-8"%>

<META http-equiv="Content-Type" content="text/html;charset=UTF-8">

request.setCharacterEncoding("UTF-8");


I really appreciate if you guys can throw some lights on this. thank you so much

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure the character encoding in your database is set to UTF-8 otherwise you won't succeed in saving these letters.

UTF-8 should be in jsp pages and database.
 
Mohammed Yousuff
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in all my JSP i have set pageEncoding as "UTF-8" and i don't know how can i set in database as UTF-8 format....


Even after setting "UTF-8" in JSP why can't i see the தமிழ் as such in my debug variable....

is there any conversion which i have to do using String object by converting using byte Array???
 
Charbel Keyrouz
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which database you are using?
MySQL, Oracle, etc...
 
Sheriff
Posts: 23696
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems to me that if you write that character to the database and then read it back, and you get the same character back, that's all you really need. A lot of people would be overjoyed if they could just have that. You don't need to interfere with the way the database stores it -- what difference does it make anyway? And you don't really need to worry about how your debugger displays it, either; there may be various reasons why it can't render that character naturally, but since it's being handled correctly that's really a minor problem in my opinion.
 
Charbel Keyrouz
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if the databases stores it as rubbish character.

In order to simply store it and read it the same way, the database should have the same character set to which this string's characters belong.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Charbel Keyrouz wrote:What if the databases stores it as rubbish character.

In order to simply store it and read it the same way, the database should have the same character set to which this string's characters belong.





I am going to write Tamil name to enter database:

kk.jsp
<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html:text name="updateForm" property="tamilName" bundle="default" />

In Action.java
if(request.getCharacterEncoding() == null)
request.setCharacterEncoding("UTF-8");
String enameT=request.getParameter("tamilName");



When it Prints in Action like ==>மனோகர்


Kindly give the Solution
...........Thanks in advance......
 
Bartender
Posts: 2407
36
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer to your question is: yes, you can save Tamil characters (or any others) in the database.

Here is some background stuff on multilingual database support in Oracle, for example. Talk to your DBA to make sure your Java client/middleware is using the same character encoding etc as the database.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!