Subject: bug#36887: coreutils-8.31: printf chokes on \u0041

From: Ulrich Mueller <[email-masked]>
Date: Thu, 01 Aug 2019 22:18:41 +0200

>>>>> On Thu, 01 Aug 2019, Pádraig Brady wrote:

> I agree this is a bit surprising.

Indeed, it most certainly violates the principle of least surprise.
Especially, it means that a shell script that will run in bash won't
run in a shell that doesn't have a built-in printf.

> The full manual states:

>   "Unicode characters in the ranges
>   U+0000...U+009F, U+D800...U+DFFF cannot be specified by this syntax,
>   except for U+0024 ($), U+0040 (@), and U+0060 (`)."

> This was previously discussed at:
> https://lists.gnu.org/archive/html/bug-coreutils/2008-05/threads.html#00067

So, there are reasons for this restriction in C99. However, I fail to
see how those reasons would apply to printf. Except for the surrogates
U+D800...U+DFFF, it looks like an arbitrary restriction, which only
makes the printf implementation incompatible with other GNU programs
(like Bash and Emacs).