You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Andrew C. Oliver" <an...@superlinksoftware.com> on 2002/08/19 19:10:20 UTC

Re: [Fwd: Encoding in HSSF (XLS) Serializer]

Within the cocoon sources under 
src/java/org/apache/cocoon/components/elementprocessor/impl/poi/hssf/elements/Cell.java,
where it says:

        }
        else if (_cell.getCellType() == HSSFCell.CELL_TYPE_STRING)
        {
            _cell.setCellValue(content);
        } else if (_cell.getCellType() == HSSFCell.CELL_TYPE_FORMULA) {

you need to add:
            _cell.setEncoding(HSSFCell.ENCODING_UTF_16);

If you want this to be a committable patch, then check for the local 
flag.  If its not us, uk or whatever the abbreviation for austrailia is, 
set it to UTF 16, otherwise set it to: |ENCODING_COMPRESSED_UNICODE| 
<http://jakarta.apache.org/poi/javadocs/org/apache/poi/hssf/usermodel/HSSFCell.html#ENCODING_COMPRESSED_UNICODE>

For further explanation see:

http://jakarta.apache.org/poi/javadocs/org/apache/poi/hssf/usermodel/HSSFCell.html#setCellValue(java.lang.String)

If you don't do it, I'll get around to it very soon.

-Andy


Hiloliddin Karimov wrote:

>Hi Andrew,
>
><map:serializer name="xls"
>src="org.apache.cocoon.serialization.HSSFSerializer"
>mime-type="application/vnd.ms-excel" locale="ru"/>
>
>I want made some changes to HSSF for encoding.
>I don't understand what I should set and where I can get encoding mode or
>type?
>Suppose I get encoding mode from Configuration but where source for
>encoding?
>void setEncoding( ???? ) {
>   ????
>}
>pls explain bit more.
>Thanks a lot,
>Hill
>
>
>-----Original Message-----
>From: Andrew C. Oliver [mailto:andy@superlinksoftware.com] 
>Sent: Saturday, August 17, 2002 6:42 PM
>To: Hiloliddin Karimov
>Subject: Re: [Fwd: Encoding in HSSF (XLS) Serializer]
>
>Hiloliddin Karimov wrote:
>
>  
>
>>Hi Andrew,
>>
>> 
>>
>>So how I can solve my problem.
>>
>>Is possible show cyrillic characters in Excel by use HSSF (XLS) 
>>Serializer?
>>
>> 
>>
>>Thanks a lot,
>>
>>Hill
>>
>>    
>>
>If you make some minor changes to the HSSF Serializer, yes.  Otherwise 
>you'll have to wait for me to do it.
>Not that you should care, but using them makes the sheet incompatible 
>with gnumeric.  
>
>All that needs to be done is if the "locale" flag is not 
>us/uk/austrailia then do the "setEncoding" flag in the underlying HSSF API.
>Please, file a bug against Cocoon it doesn't fall through the cracks.
>
>-Andy
>
>
>  
>




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