[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xml-cocoon-dev
Subject:    Re: Short Introduction to using Cocoon with non-roman languages - was: Has anyone used Cocoon for ch
From:       "roy huang" <lingererhuang () hotmail ! com>
Date:       2004-05-31 2:38:09
Message-ID: BAY2-DAV48VjCRGryWt0001e05f () hotmail ! com
[Download RAW message or body]

I use Simplified Chinese,my configuration is almost the same and I will descript the \
difference here: The basic idea is using utf-8.so:
1.(same)serializer  setting encoding utf-8 ,using iso-8859-1 you can also see Chinese \
like sample,but can't get Chinese string is client side JavaScript. \
2.(same)container-encoding remain default iso-8859-1 3.(difference)form-encoding \
remain default iso-8859-1 but using setCharacterEncodingAction action to set encoding \
to utf-8. Reason here:
form-encoding using utf-8 is fine but when you using Cocoon upload,file name will \
wrong even you try to reencoding.So,set form-encoding ISO-8859-1 and using \
setCharacterEncodingAction  when you won't process upload.You can get the file name \
correctly by: Part part = (Part) request.get(fileField);
String tmp = part.getFileName();
String fileName = new String(tmp.getBytes("ISO-8859-1"));
4.(Other)if you access sql data from CLOB/NCLOB by SQLTransformer or database \
action,this two process CLOB using getAsciiStream/setAsciiStream ,you may get wrong \
string.try get/setCharacterStream to solve this problem.Check my post here:  \
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=108571178129741&w=2

The last two I ever posted mail in dev maillist and no reply  so I send this mail to \
dev mail list tow this time.

Roy Huang



----- Original Message ----- 
From: "Jasper Michalczik" <jasper.m@gmx.net>
To: <users@cocoon.apache.org>
Sent: Saturday, May 29, 2004 4:18 AM
Subject: Short Introduction to using Cocoon with non-roman languages - was: Has \
anyone used Cocoon for chinese language application ?


Dear Reinhard, dear Cocoon-users,

I was asked to give a short explanation on how to use Cocoon for
non-roman languages - especially Arabic - which should be of use for
Chinese as well.

I'm not too firm in using Cocoon, so please feel free to correct or
extend this.


All files have to be saved as utf-8, so make sure to add/change the
first line of your xml/xsl-files:

<?xml version="1.0" encoding="UTF-8"?>

In sitemap.xmap I added the following to each serializer:

<map:serializer logger=...>
<encoding>UTF-8</encoding>
</map:serializer>

This adds the following META-Tag to the serialized document:

<META http-equiv="Content-Type" content="text/html;
charset=UTF-8">

Then I set the following parameters in web.xml...

<init-param>
<param-name>container-encoding</param-name>
<param-value>ISO-8859-1</param-value>
</init-param>
<init-param>
<param-name>form-encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>

... to make sure the forms are processed correctly.

On the client side at least Windows 2000 (I don't know about Linux or
Mac) must be used with the keyboard settings set up to allow
Arabic/Chinese typing. If you only need to display non-roman characters,
this also works with any system and a browser that supports
Unicode-display. IE5+ for example downloads the necessary fonts
automatically when needed.

I remember having some troubles using Tomcat 4.1.29, but 4.1.18 works
fine. I don't have any experiences with any other version or
servlet-container.


I only can't explain why the container-encoding in web.xml has to be set
to ISO-8859-1. If anybody knows about this, please add it to this text.
Any other setting I tried to use didn't work out.


I hope I could make a small contribution to the growing
cocoon-community...


Jasper Michalczik




-----Ursprüngliche Nachricht-----
Von: Reinhard Poetz [mailto:reinhard@apache.org] 
Gesendet: Freitag, 28. Mai 2004 14:58
An: users@cocoon.apache.org
Betreff: Re: AW: Has anyone used Cocoon for chinese language application
?

Jasper Michalczik wrote:

> Hello Vincent,
> 
> 
> 
> I developed an application with Arabic contents using cocoon. I didn't
> have any trouble yet, my xml files are stored as utf8, but I don't have
> any experiences with utf16. You only need to make sure that the form
> encoding is set accordingly, if you plan to use formulars.
> 
> 


Do you mind preparing a small sample (including instructions what you 
need on the client-side)? If not, file a Bugzilla report 
(http://nagoya.apache.org/bugzilla/index.html) and I add them to the 
Cocoon samples.

-- 
Reinhard


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


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic