[pedevel] Re: infile settings

  • From: Oliver Tappe <pedevel@xxxxxxxxxxxxxxx>
  • To: pedevel@xxxxxxxxxxxxx
  • Date: Fri, 02 Jun 2006 15:46:10 +0200

Hi,

On 2006-05-30 at 19:48:19 [+0200], Rainer Riedl <mlist@xxxxxxxxx> wrote:
> 
> let's see if here's still someone listening :-)

Yes, there is, but slowly... >;o)

> I have the problem that I often work with files with other encodings than
> UTF-8 that are mounted via CIFs. So of course there aren't any attributes
> and pe always needs to be told about the used encoding after loading. That
> really annoyed me and I was looking for a fast solution other than writing
> some encoding detection which doesn't seem to be a trivial task.
> 
> So I came up with the idea of putting the setting anywhere into the first
> line of the file. So eg. the following file would be loaded with
> ISO-8859-15 encoding used:
> 
>     <?php # [pe:ENC=ISO-8859-15]
>     ...
> 
> The format is case insensitive, all encodings used by pe are allowed, just
> replace spaces with "-". If there's interest the format could be extended
> for aoter settings later, eg.
> 
>     [pe:ENC=DOS-437,TAB=4]
> 
> could set the tab width to 4 spaces.
> 
> Please tell me what you think! If you like it I will try to find out how
> commit works in svn and put the changes into the tree where it can stay
> until a real encoding detection comes up.

I am afraid I personally do not like that approach very much and I'd prefer 
a solution that puts this kind of info into a settings file that is tagged 
onto a Pe-"project". This way, all files that are part of the project 
automatically inherit the settings. 
However, I can see that the project-based approach is far from being 
finished and that it doesn't fit with all kind of file collections anyway 
(as the project support is currently connected to a Makefile or Jamfile and 
web projects for instance do not have that).

So, from my point of view, please just go ahead and commit the change. We 
can always implement the project-based approach later and then see if 
there's a need to merge/refactor...

cheers,
        Oliver


Other related posts: