You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Velychko <v_...@ukr.net> on 2003/05/28 09:52:44 UTC

Re[2]: FOP/HSSFSerializer's and non-english characters

Wednesday, May 28, 2003, 8:08:47 AM, you wrote:

YM> On Tue, 27 May 2003 11:44:48 +0400
YM> Yury Mikhienko <Yu...@mobicomk.ru> wrote:

>> On Mon, 26 May 2003 21:35:18 +0200
>> "J.Pietschmann" <j3...@yahoo.de> wrote:
>> 
>> > Yury Mikhienko wrote:
>> >  > Cocoon's FOP/HSSFSerializer still does not support non-english characters,
>> >  > can I solve this problem?
>> > 
>> > I don't know about the HSSFSerializer, but the PDFSerializer
>> > does not have problems with non-ASCII characters. You'll have
>> > to install appropriate fonts though, refer to
>> >   http://xml.apache.org/fop/faq.html#pdf-characters
>> > and
>> > http://xml.apache.org/fop/faq.html#pdf-characters
>> > 
>> > Check the Cocoon docs for how to supply a user configuration
>> > with user fonts to the PDF serializer.
>> > 
>> > If this still doesn't solve your problem, you'll have to
>> > supply more details.
>> > 
>> 
>> Thank you, will try.
>> 

YM> Ok, the PDF serializer works properly (but with .ttf fonts only), but what about the HSSFSerializer?
YM> I still does not properly generate the exel document with russian characters :((

There is the "jakarta-poi-1.7.0-dev-20020624.jar" library in the
"cocoon-2.1/src/blocks/poi/lib". It does not support russian
characters. The support begins from version "1.8-dev".
See "http://jakarta.apache.org/poi/changes.html#1.8-dev"
The current version of POI is "2.0-pre1".

-- 
Best regards,
 Peter                            mailto:v_peter@ukr.net


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Re[2]: FOP/HSSFSerializer's and non-english characters

Posted by Yury Mikhienko <Yu...@mobicomk.ru>.
> >> >  > Cocoon's FOP/HSSFSerializer still does not support non-english characters,
> >> >  > can I solve this problem?
> >> > 
> >> > I don't know about the HSSFSerializer, but the PDFSerializer
> >> > does not have problems with non-ASCII characters. You'll have
> >> > to install appropriate fonts though, refer to
> >> >   http://xml.apache.org/fop/faq.html#pdf-characters
> >> > and
> >> > http://xml.apache.org/fop/faq.html#pdf-characters
> >> > 
> >> > Check the Cocoon docs for how to supply a user configuration
> >> > with user fonts to the PDF serializer.
> >> > 
> >> > If this still doesn't solve your problem, you'll have to
> >> > supply more details.
> >> > 
> >> 
> >> Thank you, will try.
> >> 
> 
> YM> Ok, the PDF serializer works properly (but with .ttf fonts only), but what about the HSSFSerializer?
> YM> I still does not properly generate the exel document with russian characters :((
> 
> There is the "jakarta-poi-1.7.0-dev-20020624.jar" library in the
> "cocoon-2.1/src/blocks/poi/lib". It does not support russian
> characters. The support begins from version "1.8-dev".
> See "http://jakarta.apache.org/poi/changes.html#1.8-dev"
> The current version of POI is "2.0-pre1".
> 

Thank you, Peter.
Will try again.

-- 
 
Best regards,
Yury Mikhienko.
IT engineer, ZAO "Mobicom-Kavkaz"

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: FOP/HSSFSerializer's and non-english characters

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Yury Mikhienko wrote:
>      <map:serializer name="xls"
 >           src="org.apache.cocoon.serialization.HSSFSerializer"
 >           mime-type="application/vnd.ms-excel">
>        <encoding>KOI8-R</encoding>
>      </map:serializer>

XLS is a binary format which *may* use Unicode. I don't think <encoding>
is of any use here, and asking for KOI8 encoding is definitely pointless.

J.Pietschmann


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: [SOLUTION] FOP/HSSFSerializer's and non-english characters

Posted by Joerg Heinicke <jo...@gmx.de>.
Hello Yury,

I hope you see the little problem with your solution: You change the 
library to make it work with Cocoon. So this is not a solution we can 
use for or integrate in Cocoon in general.

In the future these very POI specific java files will go back to the POI 
project and will be maintained there. So it will be easier to replace 
one version with another. But I can't say how long this takes. They seem 
to work on their 2.0 release at the moment.

Joerg

Yury Mikhienko wrote:
>>>YM> Ok, the PDF serializer works properly (but with .ttf fonts only), but what about the HSSFSerializer?
>>>YM> I still does not properly generate the exel document with russian characters :((
>>>
>>>There is the "jakarta-poi-1.7.0-dev-20020624.jar" library in the
>>>"cocoon-2.1/src/blocks/poi/lib". It does not support russian
>>>characters. The support begins from version "1.8-dev".
>>>See "http://jakarta.apache.org/poi/changes.html#1.8-dev"
>>>The current version of POI is "2.0-pre1".
> 
> For using the jakarta-poi-1.8.0-dev library in cocoon2.0.4 and Russian support implementation,
> I have implemented the several changes in  jakarta-poi-1.8.0-dev and in cocoon's hssf element processor classes:
> (POI -1.8.0-dev )
> In jakarta-poi-1.8.0/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java
> change the following
> [122]    private  Vector formats = new Vector();
> [123]    private Workbook workbook;
> [124]    private boolean movedBuiltins = false;  
> to
> [122]    private static Vector formats = new Vector();
> [123]    private static Workbook workbook;
> [124]   private static boolean movedBuiltins = false;  
> 
> and following
> [251]  public  short getFormat(String format)
> to
> [251]  public static short getFormat(String format)
> 
> (cocoon2.0.4)
> In cocoon-2.0.4/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Row.java 
> change the following
> [137] retval.setStyle(_sheet.getCellStyleForRegion(_row.getRowNum(), (short)column));
> to
> [137] retval.setStyle(_sheet.getCellStyleForRegion((short)_row.getRowNum(), (short)column));
> 
> and
> in cocoon-2.0.4/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Sheet.java
> change the 
> [341] return new Row(_sheet.createRow(rowNo), this);
> to
> [341] return new Row(_sheet.createRow((int) rowNo), this);
> 
> and
> in cocoon-2.0.4/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Cell.java
> add the 
> [120] _cell.setEncoding(HSSFCell.ENCODING_UTF_16);


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Re[2]: [SOLUTION] FOP/HSSFSerializer's and non-english characters

Posted by Yury Mikhienko <Yu...@mobicomk.ru>.
On Wed, 28 May 2003 20:20:19 +0400
Yury Mikhienko <Yu...@mobicomk.ru> wrote:

> > 
> > YM> Ok, the PDF serializer works properly (but with .ttf fonts only), but what about the HSSFSerializer?
> > YM> I still does not properly generate the exel document with russian characters :((
> > 
> > There is the "jakarta-poi-1.7.0-dev-20020624.jar" library in the
> > "cocoon-2.1/src/blocks/poi/lib". It does not support russian
> > characters. The support begins from version "1.8-dev".
> > See "http://jakarta.apache.org/poi/changes.html#1.8-dev"
> > The current version of POI is "2.0-pre1".
> > 

For using the jakarta-poi-1.8.0-dev library in cocoon2.0.4 and Russian support implementation,
I have implemented the several changes in  jakarta-poi-1.8.0-dev and in cocoon's hssf element processor classes:
(POI -1.8.0-dev )
In jakarta-poi-1.8.0/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java
change the following
[122]    private  Vector formats = new Vector();
[123]    private Workbook workbook;
[124]    private boolean movedBuiltins = false;  
to
[122]    private static Vector formats = new Vector();
[123]    private static Workbook workbook;
[124]   private static boolean movedBuiltins = false;  

and following
[251]  public  short getFormat(String format)
to
[251]  public static short getFormat(String format)

(cocoon2.0.4)
In cocoon-2.0.4/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Row.java 
change the following
[137] retval.setStyle(_sheet.getCellStyleForRegion(_row.getRowNum(), (short)column));
to
[137] retval.setStyle(_sheet.getCellStyleForRegion((short)_row.getRowNum(), (short)column));

and
in cocoon-2.0.4/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Sheet.java
change the 
[341] return new Row(_sheet.createRow(rowNo), this);
to
[341] return new Row(_sheet.createRow((int) rowNo), this);

and
in cocoon-2.0.4/src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Cell.java
add the 
[120] _cell.setEncoding(HSSFCell.ENCODING_UTF_16);


-- 
 
Best regards,
Yury Mikhienko.
IT engineer, ZAO "Mobicom-Kavkaz"

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Re[2]: FOP/HSSFSerializer's and non-english characters

Posted by Yury Mikhienko <Yu...@mobicomk.ru>.
> 
> YM> Ok, the PDF serializer works properly (but with .ttf fonts only), but what about the HSSFSerializer?
> YM> I still does not properly generate the exel document with russian characters :((
> 
> There is the "jakarta-poi-1.7.0-dev-20020624.jar" library in the
> "cocoon-2.1/src/blocks/poi/lib". It does not support russian
> characters. The support begins from version "1.8-dev".
> See "http://jakarta.apache.org/poi/changes.html#1.8-dev"
> The current version of POI is "2.0-pre1".
> 

I build and install (with cocoon2.0.4 rebuild) the jakarta-poi-1.8.0 but get the some result:
I get the "B5AB" symbols instead the "ั‚ะตัั‚" word :((
May be I must configure the HSSFSerializer (like in FOP cause)?
in sitemap.xmap I have the following configuration:

    <map:serializers default="html">
    ...
     <map:serializer name="xls" src="org.apache.cocoon.serialization.HSSFSerializer" mime-type="application/vnd.ms-excel">
       <encoding>KOI8-R</encoding>
     </map:serializer>
   ...
    </map:serializers>

may be that configuration is not complete?

Where I'm wrong?
Thanks for advise.

-- 
 
Best regards,
Yury Mikhienko.
IT engineer, ZAO "Mobicom-Kavkaz"

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org