simon-git: xcopy (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Tue May 28 19:18:21 BST 2019
TL;DR:
1d33ce3 Tolerate both UTF-8 and UTF-16 in -h -r mode.
Repository: https://git.tartarus.org/simon/xcopy.git
On the web: https://git.tartarus.org/?p=simon/xcopy.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2019-05-28 19:18:21
commit 1d33ce393b4d590aa598e596111677f72e30cee7
web diff https://git.tartarus.org/?p=simon/xcopy.git;a=commitdiff;h=1d33ce393b4d590aa598e596111677f72e30cee7;hp=9ed2ff7309e220eeac85a64272c5518dbb471ae2
Author: Simon Tatham <anakin at pobox.com>
Date: Tue May 28 19:18:14 2019 +0100
Tolerate both UTF-8 and UTF-16 in -h -r mode.
Firefox seems to have changed its handling of text/html selection data
in some recent-ish release: where it used to emit UTF-16 with a BOM,
it now emits UTF-8 with no leading identifier at all.
Fortunately, a UTF-16 BOM and UTF-8 are mutually exclusive (in that
the former begins with the bytes 0xFF and 0xFE in some order, and the
latter can't contain those bytes at all). So the user-friendly -h mode
in xcopy can reliably distinguish them, and 'translate' both to UTF-8
(in the latter case by doing nothing). Now it does so.
Our behaviour in -h _write_ mode is unchanged: we still emit UTF-16
with a BOM, which Firefox still seems quite happy to accept.
xcopy.c | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
More information about the tartarus-commits
mailing list