cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Portier <...@outerthought.org>
Subject Re: Flowscript encoding weirdness and a solution
Date Fri, 11 Mar 2005 22:11:50 GMT


Stefano Mazzocchi wrote:
> Sylvain Wallez wrote:
> 
>> 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.
> 
> 
> how about
> 
>  //@ encoding = UTF-8
> 
> instead? so that we can discriminate between comments and 'metadata 
> comments'?
> 


had a similar reflex, but from a different angle though:
namely by considering how vim is doing this:

// vim: set fileencoding=iso-8859-1 nu ai:

so: I surely like the @ idea, but am doubthing if we shouldn't 
'namespace' it some more (god knows how many more apps out there might 
be willing to do interesting annotations inside comments)


thinking of annotations, and the resemblance of js to java: we could 
require /** comments?
(which is not single line however, so stretches the first-line requirement)


-marc=
-- 
Marc Portier                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                http://blogs.cocoondev.org/mpo/
mpo@outerthought.org                              mpo@apache.org

Mime
View raw message