cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Flowscript encoding weirdness and a solution
Date Fri, 11 Mar 2005 19:05:04 GMT
Hi all,

I encountered some weird things with a flowscript containing strings 
with accented characters, saved in UTF-8. This is because the flow 
interpreter uses the platform's default encoding to read script files. 
And of course this default encoding isn't the same on Windows and Mac...

To solve this, I added the possibility to specify the file's encoding as 
a comment in the very first line of the script, e.g.

  // encoding = UTF-8
  function blah()
  ...

If no special comment exists, we fall back to the platform's default 
encoding as of today.

This works beautifully, and I'm thinking of adding this to 2.1 even if 
(or especially because) the release is coming soon.

WDYT?

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Mime
View raw message