Store Hindi Characters

Hi
I would like to store Hindi characters in my database. I am using oracle 9 and java 1.4.2. Can anybody help me as i dont know how ? Every time i save anything it is stored as a ��(upside down questionmarks). and is returned as a ? (sing question)

It depends on how much of data requires internationalization features. If the amount of hindi ( special charset ) data is more then, it makes sense to convert your database charset to UTF. If the amount of data is less, such as a few tables and few columns or maybe a schema, then you can use the NCHAR data type.
See this sample to learn how to use NCHAR datatype to retrieve and store special characters.
NCHAR Support for Unicode Data Sample
http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/9i_jdbc/index.html
How to store and retrieve multilingual data using JDBC
http://otn.oracle.com/sample_code/tech/java/codesnippet/jdbc/nls/Globalization.html
Elango.

Similar Messages

  • How to store japanese characters in mysql 5.0

    I want to store japanese characters in mysql 5.0 database through java program and then to retrive the same characters through the program only.Java program means a form containing first name ,last name and address. I am entering corresponding translations in japanese to this fields while inserting to database. In another form i am retrieving those japanese characters.those should display
    in this form.

    How to handle the unicode sir for japanese characters..Pls give me more hints and any reference links to get the answer.

  • Cannot Store Chinese Characters In Oracle 9.2.0.7 Database

    Hi,
    I'm having trouble localizing my Oracle 9.2.0.7 / ASP web application for our Chinese-speaking users.
    My Oracle 9.2.0.7 Database has NLS_NCHAR_CHARACTERSET set to AL16UTF16.
    I've set up a test table thus:
    CREATE TABLE "TBL_TEST_CH"
    field1                          NVARCHAR2(40),
    field2                          NVARCHAR2(40)
    I have the Chinese character set installed on my database / web server (same box), as well as a test client machine. I can see Chinese characters in my web browser, and can enter them in a test ASP page I've set up. When I execute an insert statement via ADO, the insert statement seems to work, but the result is that the data seems to be stored as upside-down question marks.
    I thought perhaps the data was being somehow scrambled between the web app and the database, so I set up an external table import the Chinese data from a Unicode text file:
    CREATE TABLE kenny.ch_import
         FIELD1          NVARCHAR2(255),
         FIELD2          NVARCHAR2(255)
         ORGANIZATION EXTERNAL (TYPE oracle_loader
         DEFAULT DIRECTORY ext_dat_dir
         ACCESS PARAMETERS
         (RECORDS DELIMITED BY ":"
         FIELDS TERMINATED BY "~"
         missing field values are null)
         LOCATION (ext_dat_dir:'test_ch.txt'))
         reject limit unlimited
    However, when I query the data in the external table using my web application, it comes back with garbage like "ÿþ1" and the like.
    To attempt to determine if the database is capable of storing the Chinese characters, I've performed the following test:
    1) I insert a Chinese character in an NVARCHAR2 field in my table by using the UNISTR function thus:
    insert into tbl_test_ch (field1) values (unistr('\3E00'))
    2) I interrogated the value using the dump function thus:
    select dump(field1, 1016) FROM tbl_test_ch
    I'm struggling to understand the output. Obviously the character set being used is "AL16UTF16" (which I would expect to be able to store Chinese characters), but the return_format argument I've provided to the function (1016) should return the hexadecimal code point of the character that's being stored. I would expect this to be the same as I inserted ("3E00"), but I'm getting the following output:
    DUMP(FIELD1,1016)
    Typ=1 Len=2 CharacterSet=AL16UTF16: 3e,0
    I'd really appreciate any suggestions on what I could do next to determine exactly where the problem lies. I've not been able to convince myself that the database is correctly storing the Chinese character data, but I appreciate equally that the problem could lie elsewhere.
    Thanks in advance,
    Kenny McEwan.

    Thanks, Serguisz.
    My technology stack is as follows:
    ASP 3.0 web application, running on IIS6.
    On the web servier, I have MDAC 2.8 SP2 on Windows Server 2003 SP1.
    On the Oracle database server, I have Windows Server 2003 SP1.
    My Oracle database version is 9.2.0.7.
    The client I've been using in this investigation is Internet Explorer 6.0.2900.
    It does look like you're right about characters coming from the application are being corrupted. To support this, I tried to insert the chinese character 博 as well as the Unihan character 中 from a web page in my application. I then used the dump function to interrogate the contents of the field I input to thus:
    select dump(field1, 1016) FROM tbl_test_ch
    DUMP(FIELD1,1016)
    Typ=1 Len=2 CharacterSet=AL16UTF16: 0,bf
    Typ=1 Len=2 CharacterSet=AL16UTF16: 0,bf
    Both characters seem to have suffered the same corruption.
    The problem seems to happen in the other direction as well - even after verifying that the character detailed in the previous post was stored correctly, it is still displayed by my web app as an upside down question mark.
    Do you have any suggestions on how to proceed?
    Best regards,
    Kenny.

  • How to read a file which content hindi characters.....

    I m reading a text file which content hindi characters.... but m nt getting the right result. It shows garbage instead of hindi characters.
    plz somebody help me....:(

    You posted this in the XML forum. Is this an XML file you are asking about?
    And we need definitions for some of the terms you used in your original post. You said "it shows garbage". We need to know:
    1. What is the "it" there?
    2. How does it "show" something?
    3. What does the "garbage" look like.
    In future you will find you get better answers if you write better questions.

  • Pls help.JSP: I could not store Chinese characters into files.

    Hi experts,
    I have this problem of cant store chinese characters into files(eg. .txt and .properties). I am adding
    these chinese text through a JSP website form....After i key in chinese characters in the textboxes
    in the website and sumbit the results, my chinese characters turned into ASCII or rather garbage in
    the files.
    Is there any way i can get the exact chinese characters i entered in the webite into the files?
    Need urgent assistance here.
    Thanks
    <%@ page contentType="text/html; charset=big5" %>
    <html>
    <head>
    <title>Confirmation</title>
    <meta http-equiv="Content-Type" content="text/html; charset=big5">
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    </head>
    <%@ page language="java"%>
    <%@ page import="java.io.*"%>
    <%@ page import="java.lang.Integer.*"%>
    <%@ page import="java.sql.*"%>
    <%@ page import="java.sql.ResultSet.*"%>
    <%@ page import="javax.servlet.*"%>
    <%@ page import="javax.servlet.http.*"%>
    <%@ page import="java.text.*"%>
    <%@ page import="java.util.*"%>
    <%@ page import="java.net.URL"%>
    <%
    //getting attributes from previous page form
    //At this point, chinese characters r retrieved
    //Ascii/garbage displayed for text when retrieved from previous page.
    String gameName=request.getParameter("name");
    String encode=request.getParameter("encode");
    String gameType=request.getParameter("type");
    String info=request.getParameter("description");
    int check=0;
    int nextGameID;
    String temp="";
    String langCode="";
    //establish connection
    Connection con = null;
    try {
    Class.forName("org.postgresql.Driver");
    con = DriverManager.getConnection("jdbc:postgresql://172.20.134.110:5432/smsINTFET" , "postgres",
    "postgres");
    catch(ClassNotFoundException e) {
    out.println("Could not load the driver: "+e.getMessage());
    catch(SQLException e) {
    out.println("SQLException caught in relax db: "+ e.getMessage());
    Statement stmt = null;
    ResultSet rs = null;
    ResultSet ps = null;
    String strSQL = "";
    String strSQL2 = "";
    String tempCat = "";
    strSQL="SELECT gamename FROM cp_games order by gameid;";
    try {
    stmt = con.createStatement();
    rs = stmt.executeQuery(strSQL);
    stmt.close();
    catch(SQLException e) {
    out.println("SQLException caught: "+ e.getMessage());
    while(rs.next())
    check=0;
    temp=rs.getString("gamename");
    if(temp.equalsIgnoreCase(gameName))
    // there is similar record in database
    check=1;
    break;
    else
    check=0;
    if(check==0)
    %>
    <body background="button/bkgd.jpg" bgproperties="fixed">
    <p><b><font size="30pts" face="Monotype Corsiva">Confirmation</font></b></p>
    <HR style="WIDTH: 500px; COLOR: blue; HEIGHT: 3px">
    The following information has been added.
    <table width="75%" border="0" cellspacing="0" cellpadding="2">
    <%
    String strCat="";
    strCat="INSERT INTO cp_games(gamename,description,encode) values('"+gameName+"','"+info+"','"+encode+"');";
    stmt = con.createStatement();
    stmt.executeUpdate(strCat);
    System.out.println("Successful inserted category");
    stmt.close();
    //setting language
    if(encode.equals("ascii"))
    langCode = "US";
    if(encode.equals("ms950"))
    langCode = "TW";
    if(encode.equals("ms936"))
    langCode = "CN";
    strSQL2="SELECT gameid FROM cp_games where gamename = '"+gameName+"';";
    try {
    stmt = con.createStatement();
    ps = stmt.executeQuery(strSQL2);
    stmt.close();
    catch(SQLException e) {
    out.println("SQLException caught: "+ e.getMessage());
    ps.next();
    nextGameID=ps.getInt("gameid");
    out.println("<B>The game number : </B>" + nextGameID);
    %>
    <tr>
    <td><B>Game added: </B><%=gameName%>
    </td>
    </tr>
    </table>
    <%
    String newFile="G:\\home\\smsGamesINTV2\\colorGame\\propertiesFiles\\FET\\CP_Game"+nextGameID+"_"+encode+"_"+langCode+".properties";
    try
    {               //begin file
    PrintWriter outFile=null;
    //create a new file and write the initial settings to file
    outFile=new PrintWriter(new FileOutputStream(newFile,true));
    outFile.println("game_intro="+nextGameID+")"+gameName+" - "+info);
    outFile.println("");
    outFile.println("game_title="+gameName);
    outFile.println("");
    outFile.println("game_type="+gameType);
    outFile.println("");
    outFile.println("qns_no=0");
    outFile.println("");
    outFile.println("ana_no=0");
    outFile.close();
    }//end file
    catch(IOException e)
    out.println("File Create Error");
    else // no match found
    out.println("Game,"+temp+ " already added");
    %>
    </body>
    </html>

    try to add this code under this line:
    <%@ page contentType="text/html; charset=big5" %>
    <% response.setContentType("text/html; charset=big5"); %>
    I have faced the problem like yours and it works fine for me. Try and see.

  • Cs3: Display Hindi Characters On Panel

    Hi all,
    I want to show Hindi characters on Panel
    How do i?
    I tried with statictextWidget and unicode characters.
    but it is not working.
    Please help.
    Thanks,
    Vikram

    Hi
    If you change a font for displaying on windows, message boxes etc, to for example Minion Pro, then you should be able to see Hindi characters. Think as a standard windows using Tahoma for displaying text in windows - I'm not sure about other than English version. You can check if yours Tahoma contains hindi glyphs.
    Regards
    Bartek

  • How to stor special characters in a VARCHAR2 field?

    I am trying to store a encrypted string into a 'varchar2' field. But, the encrypted string is not stored properly. Some characters are stored incorrectly.
    Can anybody help me in storing an encrypted string into a varchar2 field??

    HTH
    Laurent Schneider
    OCM DBA
    SQL> select * from z;
    S
    Mama?Mia
    a b c
    123
    SQL> select * from z where translate(s,'~ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz1234567890','~') is not null;
    S
    Mama?Mia
    SQL> select * from z where regexp_like(s, '[^[:alnum:][:space:]]');
    S
    Mama?Mia

  • Cannot Store Greek Characters in NVARCHAR2 columns

    Can someone please help.
    I have a table TEST with one column A of type NVARCHAR2(20) and when I try to insert the greek character Ω(Omega) - it gets stored as O instead.
    I am inserting using SQL Developer using the 'N' prefix and my environment is as follows:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    NLS_CHARACTERSET = WE8MSWIN1252
    NLS_NCHAR_CHARACTERSET = AL16UTF16
    NLS_LANG setting on client side is ENGLISH_UNITED KINGDOM.WE8MSWIN1252.
    Why can I not insert greek characters with the above setup and what do I need to do/change in order to be able to insert greek characters in a database using the national characterset for storing unicode data ?

    Result of running SELECT a, dump(a) FROM TEST after insert an 'O' and an 'Ω' is as follows:
    A DUMP(A)
    O     Typ=1 Len=2: 0,79
    O     Typ=1 Len=2: 0,79
    I added a VARCHAR column, column B, there is no difference in what is getting stored in the NVARCHAR column when inserting 'Ω', result is below:
    INSERT INTO TEST (A, B)
    VALUES(N'Ω', 'Ω');
    SELECT a, dump(a, 1016), b, dump(b, 1016) FROM TEST;
    A DUMP(A, 1016) B DUMP(B, 1016)
    O     Typ=1 Len=2 CharacterSet=AL16UTF16: 0,4f     O     Typ=1 Len=1 CharacterSet=WE8MSWIN1252: 4f
    I'm I missing something here, since my understanding is that NVARCHAR2 columns should be able to store Unicode data ?

  • Hindi characters' display in swing components on macintosh

    I have created a swing application that handles devanagari script.(script for Hindi language).The application works perfectly in windows but in apple macintosh
    there is a problem with the reordering of characters in text componets. Reordering means some characters needs to be displayed not in the exact order in which they are stored.I was wondering how this can happen as the application works fine on windows.Also other applications like text editor displays devanagari script correctly on macintosh.
    I tried with several fonts like Arial Unicode MS,Devanagari MT etc/.java

    Try the method setFont(java.awt.Font f) of the class java.awt.Container (which java.applet.Applet extends) with suitable fonts. This doesn't work for 1.1. Only logical fonts name are allowed here.
    You need either to edit font.properties file for corresponding logical font or for MS JVM use com.ms.awt.FontX (get it using Java reflections if you don't have MS SDK) as described at http://www.onjava.com/pub/a/onjava/2001/04/12/internationalization.html?page=1
    or http://www.jadcentral.com/newscentral/feature.jsp?feature_ID=18

  • Hindi characters' display in swing components on mac

    I have created a swing application that handles devanagari script.(script for Hindi language).The application works perfectly in windows but in apple macintosh
    there is a problem with the reordering of characters in text componets. Reordering means some characters needs to be displayed not in the exact order in which they are stored.I was wondering how this can happen as the application works fine on windows.Also other applications like text editor displays devanagari script correctly on macintosh.
    I tried with several fonts like Arial Unicode MS,Devanagari MT etc/.java

    OK, I asked the FTE team and got this reply: "Lucida Grande is CTS's fallback font for Thai.  This font on OS 10.7 and 10.6 are not supporting Thai anymore.  The version on 10.5 was supporting it." This means that it's our bug that we keep using Lucida Grande as fallback font even Apple dropped support Thai script with that font after 10.6. Unfortunately this bug was deferred from current development release (11.2) because of time constraint. If this support is critical for your business, can you open a bug in our public bugbase and ask as many vote as possible? In this way I may be able to convince internal team to fix this bug in next release.
    Thank you for your feedback!
    Hitomi

  • Newly purchased Gujarati font doesn't show Hindi characters, only English.

    I bought Gujarati and Devangari. Devangari works great in my InDesign CS6; Gujarati shows copy in English characters, not Hindi. I am using a Macintosh. The top part of the image is the Devangari type.

    Disregard. The text I import has to be in unicode in order for Gujarati to work.

  • Store Hindi Text in SQLServer and Display in JSP

    I've list of users for which I'm preparing objects of User class in which the user name is stored in hindi text.
    In the servlet which is storing the values in the database, the code is
    User = new User();
    user.setName(java.net.URLEncoder.encode(request.getParameter("userName"), "UTF-8"));I've submitted *&#2325;&#2376;&#2360;&#2375; &#2361;&#2379;* It is stored in the database in the following format
    *%C3%A0%C2%A4%C2%95%C3%A0%C2%A5%C2%88%C3%A0%C2%A4%C2%B8%C3%A0%C2%A5%C2%87+%C3%A0%C2%A4%C2%B9%C3%A0%C2%A5%C2%8B*
    When I get the data from the database and create user object and then stored it in a vector and put it in session.
    In the JSP,
    user.getName()is displaying
    *%C3%A0%C2%A4%C2%95%C3%A0%C2%A5%C2%88%C3%A0%C2%A4%C2%B8%C3%A0%C2%A5%C2%87+%C3%A0%C2%A4%C2%B9%C3%A0%C2%A5%C2%8B*
    and
    java.net.URLDecoder.decode(user.getName(), "UTF-8")is displaying
    कैसे हो
    I tried using
    request.setCharacterEncoding("UTF-8");in the servlet and
    <%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>in the JSP.
    Any suggessions?

    hi ravi...
    i had also did the same one but not in Hindi it is in Chinese language.before inserting the data into database we need convert hexadecimal code to your hindi string and you store that hex decimal value into database.
    when you retrive data from database again u convert this string to general integer format and display it.
    observe the below code..
    public String settingValue(String call) {
              System.out.println("String Value in setting::\n" + call);
              String chineseName = "";
              StringTokenizer unicodeArray = new StringTokenizer(call, "\\\\u");
              while (unicodeArray.hasMoreTokens()) {
                   String s = (String) unicodeArray.nextToken();
                   System.out.println("\nValue In setting Value::" + s);
                   chineseName += unicodeTochineseCharacter(s);
              return chineseName;
    public static String unicodeTochineseCharacter(String unicode) {
              String output = "";
              try {
                   System.out.println("\nValue In U2C::" + unicode);
                   char i = ' ';
                   i = (char) Integer.parseInt(unicode.trim(), 16);
                   output = String.valueOf(i);
                   System.out.println(" before returning..." + output);
              } catch (Exception e) {
                   System.out.println("Exception In Unicode to Chinese::\n" + e);
              return output;
         }let me know weather you need any other details...

  • Store input characters in an array

    I am trying to read characters from Keyboard. And then I have to print a fixed number of characters on each line.
    Below is the code I used for inputing the characters. But I am trying to put every character into an array. Can I use
    read(char[] cbuf, int offset, int length)
    Read characters into a portion of an array.
    But I dont know the length. HOw can I make it to work?
    class IChar {
    public static void main(String args[]) throws IOException
        char c;
             BufferedReader br = new BufferedReader(new       InputStreamReader (System.in));
           System.out.println("Enter the characters");
    do {
    c = (char) br.read();
    }  while (c != 'q');

    Read the text into a String or StringBuffer. Then use substring() to break it up into the chunks you need.

  • Formatting function for columns which store japanese characters

    I have a table which stores names in all languages.I have a SQL Report.When the names are in English the formatting is good.But when the names are in Japanese.The formatting is going wrong.
    A part of SQL report is as follows
    COLUMN emp_name formata20
    COLUMN mgr_name formata20
    select emp_name,mgr_name
    from employee;
    The data in the columns are coming in ZigZag fashions.I tried using ltrim and rtrim but had no impact.Are there any functions which would help in formatting the query.I need this very urgently.
    Thanks in advance

    Change your environment variable 'nls_lang' appropriately to reflect the language.
    For example on my computer, this variable has the value
    American_America.WE8ISO8859P1
    Typically NLS_LANG environment variable is of type:
    language_territory.charset
    If you are using Japanese character set, you could specify the environment variable as:
    JAPANESE_JAPAN.JA16EUC
    Please go through Oracle's Globalization Support Guide for additional information.

  • Some Hindi characters fail in pdf

    I work mostly with Indian langauges fonts and have ttf (and some ATM) fonts. When I try to make pdf for printing purposes, some characters do not appear in pdf. I found from the character map that they are equivalent to "no-break space" character.
    I use acrobat distiller to make pdf for prepress. It is another problem that sometimes such characters do not appear even in normal word file.
    Is there any solution to solve this problem, because, this problem appears in almost all Indian fonts.

    I am using all sort of programmes. Page Maker, Corel, Indesign, MS Word...
    In MS Word, that character does not appear at all while typing.
    Whereas in other programmes, they appear but fail to show in pdf.

Maybe you are looking for

  • Infosource -adding new objects

    I enhanced the datasource 2lis_02_itm with some objects using abap code. I created the objects in BW and replicated the datasource. I added those objects to the info source. Now , I am not able to assign these objects in the info source, I do not see

  • I was updating my iPhone 4 and it is now un ressponsive. What do I do?

    I was in the process of updating my iPhone 4 to iOS 5 and kept on getting three quarters of the way through to the 'Veryfying update with Apple' stage and then error code 3004 or 3200 would appear in iTunes. I kept on trying to update it and then aft

  • Get canvas.toDataURL('image/jpeg') and convert base64 encoding to java.sql.Blob

    Convert canvas.toDataURL('image/jpeg') to java.sql.Blob. I am using oracle adf so I am able to action a backing bean from javascript and pass in parameters as a map. I pass in the canvas.toDataURL('image/jpeg') which I then try to decode in my bean.

  • Insect flew into my MBP?

    Hello It appears that a small flying insect of some sort flew into my keyboard as I was using my Macbook Pro. It seems like the insect flew into the small section underneath the bottom of the display. Will this cause any damage to my laptop? Should I

  • Random cannot find root device at boot

    Every so often when I boot my arch install I get the error saying that it cannot find my root device.  After a reboot sometimes everything is fine other times it will will repeat.  It seems to be about a 40-60 chance that the error will occur.  This