Hi Birendar, You are getting it correct on eclipse console but not unix console. Are you running eclipse on unix or windows? By unix console do you mean that your web-app-server running on unix server. What happens if you directly put data on database from eclipse i-e run the app direct from eclipse without deploying to wep-app-server etc.
I recommend: remove all custom handling of encoding and comparing the eclipse and unix output. If you are getting something different on both instances then you have almost nabbed the problem. P.S Java handles all the string internally as UTF-16 so I think JDBC drivers would expect the same encoding by default. They would translate as necessary for target database. Also note that it is quiet possible that the particular encoding supported by your db does not support the characters in question. Regards, Tahir _____ From: Birendar Waldiya [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 4:34 PM To: 'Tahir Akhtar'; [email protected] Subject: RE: Major Problem With POI Excel reader: Urgent Help Needed Hi Tahir, I have done all the activities , the character on my eclipse console are printed as such, however in unix console they look differ for xls uplaod. The "cell.setEncoding(HSSFCell.ENCODING_COMPRESSED_UNICODE); " one i did as a last resort though i knew this is not right to do it here. still in a *HOPE* if it works >From the code you might have seen that I have tried to chage the encoding to ISO-8859-1 , UTF-8 extra etc etc Let me tell you what all I have done 1. First I tried to simply read the string cell as its avaliable into a string then try using String.getBytes("encoding") -values tries are "ISO-8859-1,ISO-8859-10,ISO-8859-13,UTF-8 " - this didnt worked . 2. Then I tried to chage the encodign of the xls file while saving : as western (ISO) , then tried to save it as "UNICODE", then I tried to save it as "UTF-8" it didnt worked 3. Then I tried to change the NLS_LANG parameter it didnt worked , 4. Then I tried to insert this data in a different databse that is UTF-8 , with String.getByets("UTF-8") this case works .. but my databse is right now not set to UTF-8 5. Finally I tried cell.setEncoding(HSSFCell.ENCODING_COMPRESSED_UNICODE); cell.setEncoding(HSSFCell.ENCODING_UTF_16); this dosnt works The greatest problem is with text uplaod it working fine for thease mentioned character , which let me puzzled a lot . BTW can you please send the URL fro downloading poi jar ? If any one in forun had ever faced this problem please guide me . Thanks Regards Birendar S Waldiya _____ From: Tahir Akhtar [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 4:36 PM To: 'Birendar Waldiya'; [email protected] Subject: RE: Major Problem With POI Excel reader: Urgent Help Needed Hi Birendar, As I told you before, I do not have any experience of using exotic character sets. Here are my best guesses however: 1. You should *not* be setting encoding when reading a file. Setting encoding will be the task of the application that created the file (in your case MS Excel). So remove following line from your code: cell.setEncoding(HSSFCell.ENCODING_COMPRESSED_UNICODE); 2. Print on console cell.getEncoding(). It would come 0 or 1. I think you should get 1 here. 3. Try printing the character on console right after you have read it from HSSFCell. What do you get at this point? For a comparison print hard coded characters Š, š, Ž, ž Looking at the archives, I would guess that encoding of source excel file would be set depending on the default encoding on the system where file was created. I hope someone with more experience with encoding and poi would be able to give you better pointers Regards, Tahir _____ From: Birendar Waldiya [mailto:[EMAIL PROTECTED] Sent: Monday, May 08, 2006 2:56 PM To: [EMAIL PROTECTED]; [email protected] Subject: Major Problem With POI Excel reader: Urgent Help Needed Hi Tahir, Thank you for your response in regards to the problem I have posted to forum, The details of probelms are as foollow : I am trying to read data from - 1. Text File : Using a text file parser that reads data from FileStreamReader 2. XLS file : This reads the data from InputStream loade to the POIFSFileSystem When using text uplaod : this workign very fine and no problem with the characetr mentioned Š, š, Ž, ž they go file and look fine in database, But when I am using the xls uplaod the aboce characters does not get dispaled correctly. I have tried to chage the cell encoding , tried to chage the string by String.getBytes("encoding") , tried to save xls file as UNICODE, UTF-8, Defualt ISO and all short of things i can thing but thease characetr doent get reflected into datase correctly. What can be done for getting charcters correctly?, My FRD is full of mention of thease charactrer they are not at all bother abot other characetr and they will test onlt tease characetr . Attaching the code that reads data from xls file Your help and guidance will be of great use for me Thanks a lot agian , leaset you replied . regards Birendar S Waldiya Birendar, I think you would have to share some more information, perhaps a code snippet if you expect any help from the forum. Try to explain your problem in more detail. Latest "release" of poi can be downloaded from poi website which is 2.5.1. You can also get the latest development version from the dev directory. Both release and development versions are available in source and binary forms. Your problems seems to be related to handling of encoding. But I do not have anything to say about it :). Regards, Tahir Akhtar -----Original Message----- From: [EMAIL PROTECTED] [HYPERLINK "mailto:[EMAIL PROTECTED]"mailto:[EMAIL PROTECTED] Sent: Friday, May 05, 2006 3:10 PM To: POI Users List Subject: Major Problem With POI Excel reader: Urgent Help Needed Hi , I am using POI API for reading data from an excel file , which is advance version of the API that read data from text file, to increase the character bandwidth ie to support special charater . However the POI api are not reading special character properly. On unix they behave differently and on windows they behave dirrerently. However my text file parser is supporting more special character them my excel reader. I am facing problem with the character "Š, š, Ž, ž" whcih are read well and inserted into databse well. But in poi apis it fail to read them properly. On windows they are read different them unix. If any one has ever face such problem please help me, I have posting my probwelm to this forum frequently for last few days but this seems to be dead forum. Can anyone tell me from where exactly I can get the POI jar latest and what is the lates version of it ? The site is so old . Please help Thanks Regards Birenadr S Waldiya =====-----=====-----===== -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.5/333 - Release Date: 5/5/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.5/333 - Release Date: 5/5/2006 -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.5/333 - Release Date: 5/5/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.392 / Virus Database: 268.5.5/333 - Release Date: 5/5/2006
