RE: Re: "Save to Clipboard" including BOM marker
From: Gavin Lambert <colnet_at_mirality.co.nz>
Date: Wed, 15 Jul 2015 18:35:38 -0700 (PDT)
On 16/07/2015 06:58, Stefan Küng wrote:
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
This shouldn't happen either. The BOM should be stripped from the file content prior to generating the diff.
> I can try to set both clipboard formats CF_TEXT *and* CF_UNICODETEXT
You probably should set both of these, but you shouldn't be including the BOM in either.
The way that Windows expects you to deal with UTF-8 files is to load them into memory as UTF-16 (stripping the BOM in the process). If written to the clipboard, CF_UNICODETEXT should get the UTF-16 representation and CF_TEXT should get the ANSI (note: not UTF-8) representation in the active codepage at the time of the copy (not the time that the original file was written). If written to a file, then it should be converted back to UTF-8-with-BOM.
------------------------------------------------------
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_tortoisesvn.tigris.org].
|
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.