• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which database you are using?
MySQL, Oracle, etc...
 
Sheriff
Posts: 27235
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic