git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Matheus Tavares <matheus.bernardino@usp.br>,
	gitster@pobox.com, git@vger.kernel.org,
	"brian m . carlson" <sandals@crustytoothpaste.net>
Subject: Re: [PATCH] t2080: fix cp invocation to copy symlinks instead of following them
Date: Thu, 3 Jun 2021 19:34:11 +0700	[thread overview]
Message-ID: <YLjMOGGVLCINlqqz@danh.dev> (raw)
In-Reply-To: <YLeMrwSiuGIzMfIN@danh.dev>

On 2021-06-02 20:50:39+0700, Đoàn Trần Công Danh <congdanhqx@gmail.com> wrote:
> On 2021-06-02 15:36:57+0200, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> > That's getting us there, now we don't fail on the 2nd test, but do start
> > failing on the third "re-encode to UTF-16 on checkout" and other
> > "checkout" tests.
> > 
> > The "test_cmp" at the end of that 3rd tests shows that the difference in
> > test.utf16.raw and test.utf16 is now that the "raw" one has the BOM, but
> > not the "test.utf16" file.
> 
> That meant we need: ICONV_OMITS_BOM=UnfortunatelyYes for AIX?
> I can replicate that test failure when building for musl libc without
> ICONV_OMITS_BOM undefined.

Applying my patch and build with ICONV_OMITS_BOM=Yes, t0028.3 passed
but t0028.4 and t0028.21 run into failure. Here is the dump of first
10 characters of test.utf16lebom:

          '0xff',
          '0xfe',
          '0xfe',
          '0xff',
          '0x0',
          '0x68',
          '0x0',
          '0x61',
          '0x0',
          '0x6c',

Digging a bit more, it seems like iconv(3) from utf-16-le-bom to utf-8
there is broken, iconv(3) thinks it's converting from utf-16-be to
utf-8:

source (test.utf16lebom, considered UTF-16LE-BOM):
|  0: ff   |  1: fe   |  2: 68 h |  3:  0   |  4: 61 a |  5:  0   |  6: 6c l |  7:  0
|  8: 6c l |  9:  0   | 10: 6f o | 11:  0   | 12: 20   | 13:  0   | 14: 74 t | 15:  0
| 16: 68 h | 17:  0   | 18: 65 e | 19:  0   | 20: 72 r | 21:  0   | 22: 65 e | 23:  0
| 24: 21 ! | 25:  0   | 26:  a   | 27:  0   | 28: 63 c | 29:  0   | 30: 61 a | 31:  0
| 32: 6e n | 33:  0   | 34: 20   | 35:  0   | 36: 79 y | 37:  0   | 38: 6f o | 39:  0
| 40: 75 u | 41:  0   | 42: 20   | 43:  0   | 44: 72 r | 45:  0   | 46: 65 e | 47:  0
| 48: 61 a | 49:  0   | 50: 64 d | 51:  0   | 52: 20   | 53:  0   | 54: 6d m | 55:  0
| 56: 65 e | 57:  0   | 58: 3f ? | 59:  0

destination (test.utf16lebom, considered UTF-8):
|  0: ef   |  1: bf   |  2: be   |  3: e6   |  4: a0   |  5: 80   |  6: e6   |  7: 84
|  8: 80   |  9: e6   | 10: b0   | 11: 80   | 12: e6   | 13: b0   | 14: 80   | 15: e6
| 16: bc   | 17: 80   | 18: e2   | 19: 80   | 20: 80   | 21: e7   | 22: 90   | 23: 80
| 24: e6   | 25: a0   | 26: 80   | 27: e6   | 28: 94   | 29: 80   | 30: e7   | 31: 88
| 32: 80   | 33: e6   | 34: 94   | 35: 80   | 36: e2   | 37: 84   | 38: 80   | 39: e0
| 40: a8   | 41: 80   | 42: e6   | 43: 8c   | 44: 80   | 45: e6   | 46: 84   | 47: 80
| 48: e6   | 49: b8   | 50: 80   | 51: e2   | 52: 80   | 53: 80   | 54: e7   | 55: a4
| 56: 80   | 57: e6   | 58: bc   | 59: 80   | 60: e7   | 61: 94   | 62: 80   | 63: e2
| 64: 80   | 65: 80   | 66: e7   | 67: 88   | 68: 80   | 69: e6   | 70: 94   | 71: 80
| 72: e6   | 73: 84   | 74: 80   | 75: e6   | 76: 90   | 77: 80   | 78: e2   | 79: 80
| 80: 80   | 81: e6   | 82: b4   | 83: 80   | 84: e6   | 85: 94   | 86: 80   | 87: e3
| 88: bc   | 89: 80

-- 
Danh

  reply	other threads:[~2021-06-03 12:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 23:58 Matheus Tavares
2021-05-27  7:25 ` Christian Couder
2021-05-27 12:51 ` Ævar Arnfjörð Bjarmason
2021-05-31 14:01   ` Ævar Arnfjörð Bjarmason
2021-05-31 16:09     ` Matheus Tavares
2021-05-31 20:41       ` Ævar Arnfjörð Bjarmason
2021-06-02  1:36     ` Đoàn Trần Công Danh
2021-06-02 10:50       ` Ævar Arnfjörð Bjarmason
2021-06-02 11:14         ` Bagas Sanjaya
2021-06-02 11:22         ` Đoàn Trần Công Danh
2021-06-02 13:36           ` Ævar Arnfjörð Bjarmason
2021-06-02 13:50             ` Đoàn Trần Công Danh
2021-06-03 12:34               ` Đoàn Trần Công Danh [this message]
2021-06-02 19:13             ` UTF-BOM was: [PATCH] t2080: fix cp invocation Torsten Bögershausen
2021-06-03  0:07         ` [PATCH] t2080: fix cp invocation to copy symlinks instead of following them brian m. carlson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YLjMOGGVLCINlqqz@danh.dev \
    --to=congdanhqx@gmail.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=matheus.bernardino@usp.br \
    --cc=sandals@crustytoothpaste.net \
    --subject='Re: [PATCH] t2080: fix cp invocation to copy symlinks instead of following them' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).