You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Parag Kalra <pa...@gmail.com> on 2010/08/28 01:06:42 UTC

Handling international characters using Apache POI 3.6

Hi All,

While printing values from Excel sheet to a text file using Apache POI, I am
facing an issue in the case of international characters.

On windows, Apache POI is able to extract international characters as it is
but on Unix international characters are being extracted as a question mark
(?)

Not sure if its a setting in Apache POI or some Unix level configuration
that is required to handle international character. I am using Apache POI
3.6

Cheers,
Parag

Re: Handling international characters using Apache POI 3.6

Posted by Parag Kalra <pa...@gmail.com>.
Ok. Found the issue.

Change was requied in the java code.

BufferedWriter out = *new* BufferedWriter(*new* OutputStreamWriter(
*new*FileOutputStream(strDirectory+
"/"+sheet_name+".out"), "UTF8"));

Now its working both on Windows and Unix.

Cheers,
Parag


On Sat, Aug 28, 2010 at 10:49 AM, Parag Kalra <pa...@gmail.com> wrote:

>
> Hmmm...
>
> The strange thing is that on the same OS (Solaris), if I manually enter a
> Unicode character in a text file, I am being able to read it using editors
> like vi or cat
>
> EG:
>
> bash-3.00$ echo -e "\340" > unicode.out ; cat unicode.out
> à
> bash-3.00$
> Hence thought that it could be an issue with Apache POI or may be the java
> version of te operating system.
> Cheers,
> Parag
>
>   On Sat, Aug 28, 2010 at 10:38 AM, Nick Burch <ni...@alfresco.com>wrote:
>
>>   On Sat, 28 Aug 2010, Parag Kalra wrote:
>>
>>> By international characters, I mean multibyte characters like - à
>>>
>>
>> POI handles unicode characters in all the file formats just fine - it's a
>> java program, and does the right thing about converting what's in the files
>> into unicode in the JVM.
>>
>> You'll want to go and learn how to configure your OS properly for unicode.
>> Once you've done that, it'll all be fine, be it Linux, AIX, OSX, Windows or
>> whatever.
>>
>> Nick
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>>
>
>

Re: Handling international characters using Apache POI 3.6

Posted by Parag Kalra <pa...@gmail.com>.
Hmmm...

The strange thing is that on the same OS (Solaris), if I manually enter a
Unicode character in a text file, I am being able to read it using editors
like vi or cat

EG:

bash-3.00$ echo -e "\340" > unicode.out ; cat unicode.out
à
bash-3.00$
Hence thought that it could be an issue with Apache POI or may be the java
version of te operating system.
Cheers,
Parag

On Sat, Aug 28, 2010 at 10:38 AM, Nick Burch <ni...@alfresco.com>wrote:

> On Sat, 28 Aug 2010, Parag Kalra wrote:
>
>> By international characters, I mean multibyte characters like - à
>>
>
> POI handles unicode characters in all the file formats just fine - it's a
> java program, and does the right thing about converting what's in the files
> into unicode in the JVM.
>
> You'll want to go and learn how to configure your OS properly for unicode.
> Once you've done that, it'll all be fine, be it Linux, AIX, OSX, Windows or
> whatever.
>
> Nick
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>

Re: Handling international characters using Apache POI 3.6

Posted by Nick Burch <ni...@alfresco.com>.
On Sat, 28 Aug 2010, Parag Kalra wrote:
> By international characters, I mean multibyte characters like - à

POI handles unicode characters in all the file formats just fine - it's a 
java program, and does the right thing about converting what's in the 
files into unicode in the JVM.

You'll want to go and learn how to configure your OS properly for unicode. 
Once you've done that, it'll all be fine, be it Linux, AIX, OSX, Windows 
or whatever.

Nick

Re: Handling international characters using Apache POI 3.6

Posted by Parag Kalra <pa...@gmail.com>.
By international characters, I mean multibyte characters like - à

Cheers,
Parag



On Fri, Aug 27, 2010 at 4:06 PM, Parag Kalra <pa...@gmail.com> wrote:

> Hi All,
>
> While printing values from Excel sheet to a text file using Apache POI, I
> am facing an issue in the case of international characters.
>
> On windows, Apache POI is able to extract international characters as it is
> but on Unix international characters are being extracted as a question mark
> (?)
>
> Not sure if its a setting in Apache POI or some Unix level configuration
> that is required to handle international character. I am using Apache POI
> 3.6
>
> Cheers,
> Parag
>
>