Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Oct 2024 14:03:49 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 281796] /bin/ls doesn't print UTF-8 emojis properly in some cases, but /bin/du does
Message-ID:  <bug-281796-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D281796

            Bug ID: 281796
           Summary: /bin/ls doesn't print UTF-8 emojis properly in some
                    cases, but /bin/du does
           Product: Base System
           Version: 14.1-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: henrichhartzer@tuta.io

I had some filenames with emojis on my filesystem and noticed an interesting
behavior.

I noticed that /bin/du will print the filename and size with the emoji, but
/bin/ls prints question marks.

zsh$ du this-has-an-apple-emoji-$'\360'$'\237'$'\215'$'\216'
0       this-has-an-apple-emoji-=F0=9F=8D=8E
zsh$ ls this-has-an-apple-emoji-$'\360'$'\237'$'\215'$'\216'
this-has-an-apple-emoji-????
zsh$ du this-has-an-apple-emoji-$'\360'$'\237'$'\215'$'\216' | hexdump -C
00000000  30 09 74 68 69 73 2d 68  61 73 2d 61 6e 2d 61 70  |0.this-has-an-=
ap|
00000010  70 6c 65 2d 65 6d 6f 6a  69 2d f0 9f 8d 8e 0a     |ple-emoji-....=
.|
0000001f
zsh$ ls this-has-an-apple-emoji-$'\360'$'\237'$'\215'$'\216' | hexdump -C
00000000  74 68 69 73 2d 68 61 73  2d 61 6e 2d 61 70 70 6c  |this-has-an-ap=
pl|
00000010  65 2d 65 6d 6f 6a 69 2d  f0 9f 8d 8e 0a           |e-emoji-.....|
0000001d

Although, I think it's more complicated than that. This is my behavior with
x11/foot, but not with x11/sterm.

This may not be a /bin/ls bug, but seems to be a discrepancy between /bin/ls
and /bin/du.

I can't immediately tell an obvious difference in the hexdump, so I wonder =
if
there's some kind of terminal signaling going on or not going on that's
changing how it's printed.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-281796-227>