I have to read multibyte (Japanese and Chinese) characters of an excel sheet and store in database table. I am setting encoding and character set to Excel Driver but its not displaying only ??? question marks. How to read the Japanese and Chinese Characters using Excel jdbcodbc driver. Any help in this regard is appreciated.
I am writing the strings to text file and opening the text file in Edit Pro that supports UTF-8. But when I open the file, text is displayed as ??? question marks. I need to store the characters as Japanese and Chinese not as ???. How to do this using Excel Driver. Any property or logic is required to do this? [ November 20, 2008: Message edited by: phani dar ]
Joined: Mar 22, 2005
Does the editor recognize the file as Unicode? The code you posted doesn't write a BOM, so the editor may be treating it as some other encoding.
Also, does the editor have access to fonts that can display those characters? Some editors use only monospaced fonts (which would rule out Japanese/Chinese fonts, unless they are especially constructed as monospaced, and recognizable as such by the font engine).
Joined: Nov 19, 2008
Before sending the data to database, I am trying with text file. Once the file opens properly in the editor, I will go with Database. But that is not happening even for text file. The editor has support for unicode.
When I use HSSF POI pakcage the work is done. But POI consumes more memory. The hunch is for JDBCODBC driver to Connect Excel.
Joined: Mar 22, 2005
The editor having support for Unicode is not the same as the editor recognizing a file as being in Unicode. It takes a BOM (or smart code in the editor) to determine that.
In the Java code -before you save it to a file- have you checked whether the characters are the correct Unicode characters? That would tell you whether the problem is getting the data through JDBC, or saving the data to a file. (Assuming that the data is not saved correctly; from your description it's not clear to me that it isn't.)
I found a solution to the problem of the JDBC-ODBC driver conversion of multibyte characters like Chinese or Japanese. In my case the JDBC driver worked just fine with resultSet.getString(columnName); but not the ODBC driver.