Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-vcm-dev] File line terminators - setting default and programatically converting

As far as I know, Eclipse always uses the platform encoding and you can't
force it to use a different one.

There is a preference for editors to use a different encoding, but I don't
think this will help you -- its there so that people can manage getting a
file in a format different than that of the OS, and besides this has to do
with file encoding (e.g. ASCII vs. UTF-8 vs....)  and not just EOL.

However, what you can do is convert the EOL's when you are transferring the
files to/from the server.  This is how the CVS provider works.  You can
look through the CVS core plugin to see how this is done, there is nothing
magic.

Cheers,
Kevin




                                                                                                                      
                      "MKT"                                                                                           
                      <mark.kt@xxxxxxxxx>             To:      "Eclispe VCM dev newsgrou"                             
                      Sent by:                        <platform-vcm-dev@xxxxxxxxxxx>                                  
                      platform-vcm-dev-admin@         cc:                                                             
                      eclipse.org                     Subject: [platform-vcm-dev] File line terminators - setting     
                                                      default and programatically converting                          
                                                                                                                      
                      10/30/2002 06:02 PM                                                                             
                      Please respond to                                                                               
                      platform-vcm-dev                                                                                
                                                                                                                      
                                                                                                                      



I am writing a VCM plugin, unfortunately the version control system I am
using CMVC,
insists on given me files with Windows line terminators, when I call it
from windows.
But I want to always use Unix line terminators......

I run Eclipse on NT, accessing files on a UNIX shared drive.
I want all files to use Unix line-feeds, even though they might be created
on NT.

- How can I set the default line terminator in Eclipse?
  - Can I force files to be terminated in a certain way (for certain types
of files - so as not to damage binary files)

- I also need to programmatically change line termination.
How can I re-use the Eclipse code to do this?
-- i.e. how can I ask to set line termination on a resource?
-- do I need to do anything different to do this from within a team
plugin's file-edit-validate hook?

Thanks,
Mark.






Back to the top