Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-core-dev] Re: [eclipse-dev] request for comments - improved file encoding support


Yes, this is true. I made my statement under the assumption that the encoding could be set at the same time that the contents of the resource were set. This would make the extra overhead of setting the encoding rather insignificant. However, there are a couple of cases where this is a problem:

1) The reposiory provider populats the workspace by creating java.io.Files and then refreshes inside Eclipse.

2) The repository provider cannot efficiently determine the file encodng when it is recieving contents from the server.

In light of this, it may be worth considering an additional hook (like the move/delete or validateEdit hooks)  which gives the repository provider a chance to update the encoding when it is requested.

Michael



Boris Pruessmann <boris@xxxxxxxxxxxxxx>
Sent by: platform-core-dev-admin@xxxxxxxxxxx

12/06/2003 11:22 AM
Please respond to platform-core-dev

       
        To:        platform-core-dev@xxxxxxxxxxx
        cc:        
        Subject:        Re: [platform-core-dev] Re: [eclipse-dev] request for comments - improved file encoding support




Michael,

I think this might be an issue of performance. When adding a project to the
workspace, a team provider supporting encoding would have to call
setEncoding on each resource. I think it might be wiser to defer this to the
very moment very the encoding is really needed...

-Boris

On Thu, 12 Jun 2003, Michael Valenta wrote:

> Boris,
>
> I would argue that, if a Team provider stores encoding information for a
> project, folder or file, the provider can use the proposed API on
> IResource to ensure the file encodings in Eclipse match those in the
> epository. For example, when a project is loaded from a repository, the
> provider would set the file encodings properly. When resources are added
> to the repository or checked in, the provider would obtain the file
> encoding from the IResource. I can't see any reason why this wouldn't be
> adequate. If you know of specific cases where this wouldn't be enough,
> please post them so they can be addressed.
>
> Michael Valenta
>
> > I think you should also provide a way for querying an associated Team
> > provider for encoding information. There are some SCMs out there that
> > either know the encoding of a file or that provide conversion between
> > charsets on their own.
>
> > -Boris
>
> On Tue, 10 Jun 2003, Rafael Chaves wrote:
>
> > Hi all,
> >
> > Platform/Core has started working on improving file encoding support
> (plan
> > item - bug 37933). The goal is to allow clients to find out which
> specific
> > encoding should be used when reading the contents of a file using a text
>
> > stream.
> >
> > The initial proposal is under the Platform/Core web area (Core Component
>
> > Planning -> Commited Items). Here is a direct link (may be split in two
> > lines):
> >
> >
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-core-home/plan_encoding_intro.html
>
> >
> > This work would involve changing all clients of IFile.get/setContents
> that
> > use text streams  (Java Core/UI, Search, Platform Text, Compare, ...)
> to,
> > instead of using the workspace default encoding, use the resource
> specific
> > encoding, and to react to resource change notifications regarding
> changes
> > of encoding. We would also need UI (Platform/JDT) for
> (re)setting/browsing
> > encodings on resources. Also, the current mechanism in Platform Text for
>
> > setting encodings would have to be retrofiited to work with the new
> > support from Core.
> >
> > We need feedback from the affected teams on whether this proposal makes
> > sense for their needs and their willingness to adopt/expose the new
> > functionality.
> >
> > Thanks,
> >
> > Rafael
> >

--
"Engineering does not require science. Science helps a lot but
people built perfectly good brick walls long before they knew why
cement works." - Alan Cox


_______________________________________________
platform-core-dev mailing list
platform-core-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-core-dev


Back to the top