[Webfunds-devel] cross-platform Line endingscross-platform line endings

Edwin Woudt edwin@webfunds.org
Wed, 16 Aug 2000 23:50:37 +0000


--On 08/16/00 17:26:55 -0400 Ian Grigg <iang@systemics.com> wrote:

> Edwin Woudt wrote:
>
>> What exactly is the bug here? OpenPGP removes trailing spaces and applies
>> uniform line endings before signing, so what's the problem?
>
> the Wizard saves the file to disk in OpenPGP internal format,
> which means that you always get CR/NL for the end of every line.
>
> This works fine on DOS, but on MAC and UNIX means the file has
> the wrong line endings.
>
> So the fix is to convert it to canonical format before saving
> the file.  Now this could be done out of Contract.java which
> has some code to do this.  I could look at that.  Or it could
> be done by the Wizard code, in which case I'm not sure what the
> bext way to do this is.
>
> Possibly, via Contract makes more sense, that is after all what
> this code is about producing.


I think we all misunderstood eachother... there are two sections in your 
list that deal with line endings (and trailing spaces):


      I.a)  Contract - all these can be repaired and saved on the fly

        + no trailing spaces
        + uniform line endings


     II.a)  Contract should be written out in local format
            (with platform line ending, currently has ^M on Unix).



IMHO, the first one is fixed (the unsigned contract is stripped of all 
trailing spaces and converted to \r\n line endings, because otherwise the 
signatures would not work), the second one is not.

Is there a standard way to determine the local format?


Edwin