If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > JAVA > UTF-8 to BIG5 conversion

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-14-07, 01:41
smurfuhrer smurfuhrer is offline
Registered User
 
Join Date: Mar 2007
Posts: 2
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?
Reply With Quote
  #2 (permalink)  
Old 03-14-07, 16:25
dimis2500 dimis2500 is offline
Registered User
 
Join Date: Jan 2005
Posts: 362
Encoding

You may look at encoding and java as sample.
Reply With Quote
  #3 (permalink)  
Old 03-15-07, 06:17
smurfuhrer smurfuhrer is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On