cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "roy huang" <lingererhu...@hotmail.com>
Subject Re: [Help]How can I use non-ascii file name?
Date Thu, 02 Sep 2004 11:13:49 GMT
After reading all the following mail,I finally using flowscript to solve this problem(thought
I don't like this way)
sitemap:
   <map:match pattern="images">
    <map:call function="display" >
    </map:call>
   </map:match>
   <map:match pattern="*.jpg">
    <map:read mime-type="image/jpg" src="jpg/花.jpg" />
   </map:match>
flowscript:
function display(){
name=cocoon.request.getParameter("name");
name1=new Packages.java.lang.String(name);
cocoon.sendPage(name1);
}

it works,if you want to decode it,you can also :
name2=new Packages.java.lang.String(name1.getBytes("ISO-8859-1"));

Thought,I don't like this way,just post it hope it is helpful for somebody.

Roy Huang
----- Original Message ----- 
From: "roy huang" <lingererhuang@hotmail.com>
To: <users@cocoon.apache.org>; <dev@cocoon.apache.org>
Sent: Thursday, August 12, 2004 7:45 PM
Subject: [Help]How can I use non-ascii file name?


> Hi,all:
>     Use reader to display jpg or gif is quite simple,like:
>    <map:match pattern="*.jpg">
>     <map:read mime-type="image/jpg" src="jpg/{1}.jpg" />
>    </map:match>
>    But if the file name is not ASCII but utf-8 or other encoding like 花.jpg (simplified
Chinese),the resolver didn't resolve the name correctly,error occur:
> org.apache.cocoon.ResourceNotFoundException: Error during resolving of the input stream:
org.apache.excalibur.source.SourceNotFoundException: file:/C:/My Documents/IBM/wsad/workspace/PowerOA/WebContent/test/jpg/花.jpg
doesn't exist.
> 
> How can I use non-ASCII file name in cocoon?I can't find any description or help in wiki
or archived mail list. 
> 
> Roy Huang
Mime
View raw message