Re: bug report: symbolic-ref --short command echos the wrong text while use Chinese language
On Mon, Feb 13, 2023 at 3:49 PM Jeff King <peff@peff.net> wrote:
Show 18 quoted lines
> On Mon, Feb 13, 2023 at 02:38:08PM +0800, 孟子易 wrote:
> > System: Mac Os (Ventura 13.2)
> > Language: Chinese simplified
> > Preconditions:
> > # git checkout -b 测试-加-增加-加-增加
> > # git symbolic-ref --short HEAD
> > Wrong Echo (Current Echo):
> > 测试-�
> > Correct Echo:
> > // I Don't know, may be "测试-加" ?
>
> Hmm, I can't reproduce here on Linux:
>
> $ git init
> $ git commit --allow-empty -m foo
> $ git checkout -b 测试-加-增加-加-增加
> $ git symbolic-ref --short HEAD
> 测试-加-增加-加-增加
I am able to reproduce the broken behavior on maOS 10.13.
Show 10 quoted lines
> I wonder if it is related to using macOS. The refs are stored as
> individual files in the filesystem, and HFS+ will do some unicode
> normalization. So I get:
>
> $ ls .git/refs/heads/ | xxd
> 00000000: 6d61 696e 0ae6 b58b e8af 952d e58a a02d main.......-...-
> 00000010: e5a2 9ee5 8aa0 2de5 8aa0 2de5 a29e e58a ......-...-.....
> 00000020: a00a
>
> Are your on-disk bytes different?
I get the exact same results (on HFS+) as you show:
$ ls .git/refs/heads/ | xxd
00000000: 6d61 696e 0ae6 b58b e8af 952d e58a a02d main.......-...-
00000010: e5a2 9ee5 8aa0 2de5 8aa0 2de5 a29e e58a ......-...-.....
00000020: a00a ..