-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
J - Encodingencoding (UTF-8, UTF-16) related issueencoding (UTF-8, UTF-16) related issueU - echoU - printf
Description
❯ coreutils echo "$(coreutils printf 'A \xFF Z')"
error: invalid UTF-8 was detected in one or more arguments
Usage: coreutils echo [OPTIONS]... [STRING]...
For more information, try '--help'.
❯ /usr/bin/echo "$(coreutils printf 'A \xFF Z')"
A � Z
❯ coreutils printf "$(coreutils printf 'A \xFF Z')\n"
error: invalid UTF-8 was detected in one or more arguments
Usage: coreutils printf FORMATSTRING [ARGUMENT]...
coreutils printf FORMAT [ARGUMENT]...
coreutils printf OPTION
For more information, try '--help'.
❯ /usr/bin/printf "$(coreutils printf 'A \xFF Z')\n"
A � ZI'm not sure if this is practically relevant. You can't print arbitrary binary data with echo/printf anyway, because the arguments are C strings (null terminated).
Metadata
Metadata
Assignees
Labels
J - Encodingencoding (UTF-8, UTF-16) related issueencoding (UTF-8, UTF-16) related issueU - echoU - printf