Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2007
    Posts
    4

    Question Unanswered: insert Chinese characters or retrieve from oracle 9i

    Hi all,

    How to insert Chinese characters or retrieve from oracle 9i, currently I am developing a system that need to display/store Chinese characters but when I am trying to retrieve the Chinese characters from database ,it will change to funny characters. I have try to changes NLS setting for registry but still cannot and I am inserting the Chinese characters via toad, when I try insert it to oracle ,the characters is in correct format (I have set the regional setting to “PRC”) but I try it to display in web page, it become funny characters.

    Please help.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by bok
    I have try to changes NLS setting for registry but still cannot and I am inserting the Chinese characters via toad
    Are you sure your TOAD version supports chinese characters?
    Quote Originally Posted by bok
    when I try insert it to oracle ,the characters is in correct format
    How do you know? Which tool do you use to verify that?
    Quote Originally Posted by bok
    but I try it to display in web page, it become funny characters.
    So if the data is correctly stored in the database, the problem is your web application and not the database.
    Are you sure your HTML pages are UTF-8 encoded?

  3. #3
    Join Date
    Nov 2007
    Posts
    4
    Version of the toad is 8.6.1.0, and in the html there i have put this <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />inside <head>
    i canot confirm that the characters is stored correctly but when they been inserted to table ,they are in correct format(not in funny characters).
    Is it anyway to ensure that the chinese characters is inserted corectly?

  4. #4
    Join Date
    Nov 2007
    Posts
    4
    Version of the toad is 8.6.1.0, and in the html there i have put this <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />inside <head>
    i canot confirm that the characters are stored correctly but when they been inserted to table ,they are in correct format(not funny characters).
    Is it anyway to ensure that the chinese characters are inserted corectly?

  5. #5
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Quote Originally Posted by bok
    Version of the toad is 8.6.1.0
    and that version does support chinese? I have never used TOAD, so I cannot tell. Did you verify that?
    Quote Originally Posted by bok
    and in the html there i have put this <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    Putting the encoding information in the head tag is one pre-requisite, but are you actually writing the html pages in in UTF8? Does your web-application create the pages with that encoding?

    The statement:
    i canot confirm that the characters is stored correctly
    contradicts this statement
    but when they been inserted to table ,they are in correct format(not in funny characters).
    How do you know they are in the correct format?
    And how do you insert those values into the database?

    Which characterset is specified for the database?
    If you don't know the characterset, you can check it using the following statement:
    Code:
    SELECT *
    FROM nls_database_parameters
    WHERE PARAMETER in ('NLS_NCHAR_CHARACTERSET', 'NLS_CHARACTERSET')
    Is it anyway to ensure that the chinese characters is inserted corectly?
    Use a SQL tool that supports chinese characters.

  6. #6
    Join Date
    Nov 2007
    Posts
    4
    i insert chinese characters by running following script in toad
    INSERT INTO table(column) VALUES( N'chinese' )

    value for NLS_NCHAR_CHARACTERSET,NLS_CHARACTERSET are UTF8
    Last edited by bok; 11-05-07 at 05:04.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •