Solved

Jakarta POI - Java API To Access Microsoft Format Files

Posted on 2004-08-26
5
277 Views
Last Modified: 2010-03-31
Hello, experts

I have a problem could you please help me ?

It is my first time I am using the POI to access Microsoft excel files and I am facing the problem of Unicode one more time.

My excel files have Unicode characters.
When I parse the files with the POI the characters are becoming '?'
It seems that it does not read the files as UTF-8

I cannot believe that they haven't  thought about that the people that made this.

I htought of opening the source code and try to find out where is the Reader to set it by hand, but it must be another easier way

Anybody can help ????

Thank you in advance
0
Comment
Question by:pouli
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:pouli
ID: 11901677
Here is a small part of code that sets the encoding

                              while( cells.hasNext() ) {
                                    HSSFCell cell = (HSSFCell) cells.next();
                                    
                                    //System.out.println(cell.getEncoding());
                                    cell.setEncoding( HSSFCell.ENCODING_UTF_16 );

I does not work though
0
 
LVL 35

Accepted Solution

by:
girionis earned 125 total points
ID: 11901746
Where do you display the data and you see ???. It might be that you read the data correctly but the display screen does not support unicode. Can you write to a file and see if you still have problems?
0
 

Author Comment

by:pouli
ID: 11901785
I am writing the contents to files.

But you have just gave me the idea that I the program that someone else gave me might not write to the right encoding.

I am checking it now.

Give me a sec
0
 

Author Comment

by:pouli
ID: 11902014
Yes the file I took was not using the right encoding.

Thank u girionis
0
 
LVL 35

Expert Comment

by:girionis
ID: 11903897
Thank you for accepting :)

As a tip, Java is by default unicode so it should work on most cases. DOS prompt and some shell of *nix implementaiton do not support unicode so you might be seeing ??? instead of characters. It is always good to write the data to a file and open them with an editor that supports unicode encoding.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question