[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: "Save to Clipboard" including BOM marker

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Thu, 16 Jul 2015 18:27:12 +0200

On 16.07.2015 03:35, Gavin Lambert wrote:
> On 16/07/2015 06:58, Stefan Küng wrote:
>> When you copy the patch to the clipboard, it is copied *exactly*
>> the same as if it was written to a file. You can test that yourself
>> with a clipboard spy utility if you like. The BOM is written as
>> three bytes 0xEF 0xBB 0xBF.
>
> This seems incorrect. The clipboard should only contain textual
> content; it should not include an initial BOM in any case. (*Files*
> contain an initial BOM because there is otherwise no reliable way to
> determine if the content is ANSI or Unicode. The clipboard does not
> have that issue.)
>
>> The real problem is that the BOM in a patch file does not appear at
>> the start of the content but in the middle where the diffed line is
>> shown, and most editors can not handle that properly. Because for
>> text files, the BOM only appears either at the beginning, or if in
>> the middle should be treated as the "Word Joiner" character.
>
> This shouldn't happen either. The BOM should be stripped from the
> file content prior to generating the diff.

Sorry, but that would be a big bug.
The diff must contain the BOM, because it would be broken if you add or
remove the BOM from a file, and then do a diff: if a patch file would
not contain changes to the BOM, you could not apply such a patch file
and get the correct results.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest interface to (Sub)version control
    /_/   \_\     http://tortoisesvn.net
------------------------------------------------------
http://tortoisesvn.tigris.org/ds/viewMessage.do?dsForumId=4061&dsMessageId=3127411
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
Received on 2015-07-16 18:27:19 CEST

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.