bug-coreutils@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Ulrich Mueller <ulm@gentoo.org>
To: 36887@debbugs.gnu.org
Cc: base-system@gentoo.org
Subject: bug#36887: coreutils-8.31: printf chokes on \u0041
Date: Thu, 01 Aug 2019 13:02:26 +0200	[thread overview]
Message-ID: <w6gh871tagt.fsf@kph.uni-mainz.de> (raw)

[Forwarding bug https://bugs.gentoo.org/680244 as requested by the
Gentoo package maintainer.]

According to printf(1):

   Interpreted sequences are:
   [...]
   
   \uHHHH Unicode (ISO/IEC 10646) character with hex value HHHH (4 digits)

   \UHHHHHHHH
          Unicode character with hex value HHHHHHHH (8 digits)

It does not work, though:

$ /usr/bin/printf '\u0041\n'
/usr/bin/printf: invalid universal character name \u0041
$ /usr/bin/printf '\U00000041\n'
/usr/bin/printf: invalid universal character name \U00000041

Other tools interpret the sequence correctly:

$ printf '\u0041\n'   # bash
A
$ echo -e '\u0041'    # bash
A
$ zsh -c "echo -e '\u0041'"
A
$ emacs -Q --batch --eval '(princ "\u0041\n")'
A
$ python -c "print ('\u0041')"
A
$ ruby -e 'print("\u0041\n")'
A




             reply	other threads:[~2019-08-01 11:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-01 11:02 Ulrich Mueller [this message]
2019-08-01 13:09 ` bug#36887: coreutils-8.31: printf chokes on \u0041 Pádraig Brady
2019-08-01 20:18   ` Ulrich Mueller
2019-08-01 23:37     ` Paul Eggert
2019-08-02  8:00       ` Ulrich Mueller
2019-08-02 10:14       ` L A Walsh
2023-06-07 14:16 ` Ulrich Mueller
2023-06-07 14:57   ` Pádraig Brady

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-coreutils

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

  git send-email \
    --in-reply-to=w6gh871tagt.fsf@kph.uni-mainz.de \
    --to=ulm@gentoo.org \
    --cc=36887@debbugs.gnu.org \
    --cc=base-system@gentoo.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).