Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 56980 invoked from network); 11 Mar 2005 22:11:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 11 Mar 2005 22:11:58 -0000 Received: (qmail 38720 invoked by uid 500); 11 Mar 2005 22:11:56 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 38662 invoked by uid 500); 11 Mar 2005 22:11:55 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 38649 invoked by uid 99); 11 Mar 2005 22:11:55 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from smtp1.xs4all.be (HELO smtp1.xs4all.be) (195.144.64.135) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 11 Mar 2005 14:11:54 -0800 Received: from [192.168.124.107] (195-144-088-147.dyn.adsl.xs4all.be [195.144.88.147]) (authenticated bits=0) by smtp1.xs4all.be (8.12.10/8.12.10) with ESMTP id j2BMBplY029722 for ; Fri, 11 Mar 2005 23:11:51 +0100 Message-ID: <423217A6.7000302@outerthought.org> Date: Fri, 11 Mar 2005 23:11:50 +0100 From: Marc Portier Organization: Outerthought User-Agent: Mozilla Thunderbird 0.8 (X11/20041012) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@cocoon.apache.org Subject: Re: Flowscript encoding weirdness and a solution References: <4231EBE0.5050101@apache.org> <4231ECB4.6030004@apache.org> In-Reply-To: <4231ECB4.6030004@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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