poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alain Mowat" <amo...@bluewin.ch>
Subject Re: Problems with HSSF and character sets
Date Tue, 09 Jan 2007 20:09:01 GMT
Thanks for the answer, unfortunately, I'm already using the RichTextStrings.
And the problem is it modifies the values in some fields that I don't even
touch. Just by saving a file I just opened introduces these errors...

Alain
----- Original Message ----- 
From: "Vincent" <vincent82@gmail.com>
To: "POI Users List" <poi-user@jakarta.apache.org>
Sent: Tuesday, January 09, 2007 2:29 PM
Subject: Re: Problems with HSSF and character sets


> Maybe you should try HSSFRichTextString. I have also using verison 3.0
> alpha 3 , not met the problem you mentioned.
>
> setCellValue
>
> public void setCellValue(HSSFRichTextString value)
>
>     set a string value for the cell. Please note that if you are using
> full 16 bit unicode you should call setEncoding() first.
>
>     Parameters:
>         value - value to set the cell to. For formulas we'll set the
> formula string, for String cells we'll set its value. For other types
> we will change the cell to a string cell and set its value. If value
> is null then we will change the cell to a Blank cell.
>
> On 1/8/07, Alain Mowat <amowat@bluewin.ch> wrote:
> >     I forgot to mention that I am using the version 3.0 alpha3. So it
should
> > be using unicode all the time. And in the code I posted below I don't
even
> > copy the content of the cells, I just save the file elsewhere on my
system.
> >
> >     Any more help?
> >
> >     Alain
> > ----- Original Message -----
> > From: "Andrew C. Oliver" <acoliver@apache.org>
> > To: "POI Users List" <poi-user@jakarta.apache.org>
> > Sent: Saturday, December 09, 2006 10:59 AM
> > Subject: Re: Problems with HSSF and character sets
> >
> >
> > > http://jakarta.apache.org/poi/faq.html#faq-N100A4  FAQ #11.
> > >
> > > -andy
> > >
> > > Alain Mowat wrote:
> > > >     Hello,
> > > >     I'm having problems using HSSF with czech files, and probably
other
> > languages that have special characters in them.
> > > >     If I open a file, and then simply write this same file to the
hard
> > disk with no modification whatsoever, the saving process actually
modifies a
> > certain number of characters and replaces them by a '?'.
> > > >     This happens with the following simple code :
> > > >         POIFSFileSystem fs = new POIFSFileSystem(new
> > FileInputStream("Path to file"));
> > > >
> > > >         wb = new HSSFWorkbook(fs);
> > > >
> > > >         FileOutputStream fileOut = new FileOutputStream("Some
> > location");
> > > >
> > > >         wb.write(fileOut);
> > > >
> > > >
> > > >     Strangely, not all characters are altered. For example, the word
> > "nebezpecn√°" becomes "nebezpe?n√°" in one cell, but no modification is
done
> > to the same word in the following cell.
> > > >
> > > >     It appears to come from the way the file is saved to the disk.
Maybe
> > POI saves the file as an old Excel 95 file, the same problem seems to
happen
> > when this is done directly in Excel.
> > > >
> > > >     Does anybody know how I can stop these alteration from
happening?
> > > >
> > > >     Thanks,
> > > >
> > > >     Alain
> > > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > > Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> > > The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> > Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> > The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
> >
> >
>


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Mime
View raw message