cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: Flowscript encoding weirdness and a solution
Date Fri, 11 Mar 2005 23:08:37 GMT
Marc Portier wrote:
> 
> 
> 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)

here people would suggest to embed RDF in it ;-)

KISS!

-- 
Stefano.


Mime
View raw message