Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Posts
    2

    Unanswered: UTF-8 to BIG5 conversion

    I created a JAVA program that read from Oracle DB then write to a text file, vice versa.
    My Oracle DB is using BIG5 char set.

    1. From Oracle DB to text file is OK by using THIN driver.

    2. However for transferring from text file to Oracle DB, both OCI8 and THIN drivers cannot insert the correct chinese character to the DB (using INSERT statement), it inserts ????? instead

    Anybody have idea how to solve?

  2. #2
    Join Date
    Jan 2005
    Posts
    362

    Encoding

    You may look at encoding and java as sample.

  3. #3
    Join Date
    Mar 2007
    Posts
    2

    Unhappy What is my encoding

    I change the insert sql statement in my JAVA program, by including convert function to convert 1 encoding to BIG5 encoding (my Oracle is BIG5).
    I also check using my java program to get my local encoding
    System.getProperty ("file.encoding"), it gives me 'WE8ISO8859P15'.

    So I change the INSERT sql to include conversion from 'WE8ISO8859P15' to BIG5 -->
    vlSqlQuery = "INSERT INTO mytable (str_myfield) VALUES (convert " +str_myfield + ", 'WE8ISO8859P15', 'ZHT16BIG5'))";

    str_myfield is data read from my txt file

    The result is different but still garbled.
    I also tried from 'UTF8', 'AL32UTF8', 'AL16UTF16', 'US7ASCII', 'UTFE' to 'ZHT16BIG5' with no avail.

    Any idea what is my java encoding? Why not 'WE8ISO8859P15' as returned by System.getProperty ("file.encoding")?

    Then environment of the server running my java program shows:
    LC_ALL=en_GB.ISO8859-15 (which means 'WE8ISO8859P15' encoding).

    Help, help

Posting Permissions

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