On 9/3/23 4:22 PM, Robert Elz via austin-group-l at The Open Group wrote:
     Date:        Sun, 3 Sep 2023 07:36:59 +0100
     From:        Stephane Chazelas <steph...@chazelas.org>
     Message-ID:  <20230903063659.mzyfen4evyrnz...@chazelas.org>

   | though has the same limitation as my bash echo -e "$*\n\c"

Yes, I know, though as nothing anywhere says what echo is supposed
to do with a lone trailing \ (or in fact, a \ that is not followed
by one of the defined escape sequences), I treat that as unspecified,

It's not specified, rather than being explicitly unspecified, so
anything goes. Bash just outputs the `\' in this case.


   | $ LC_ALL=zh_TW luit
   | $ locale title charmap
   | Chinese locale for Taiwan R.O.C.
   | BIG5
   | $ echo() { printf '%b ' "$@"\\n\\c; }
   | $ echo 'α'
   | αn%

That one is a different issue, and seems to me to be a simple
implementation bug (and no, I am not claiming that NetBSD wouldn't
act just like that) - characters ought to be fully formed before
testing their values.

I suspect this is the result of printf's history as a byte-oriented
utility, everyone still treats the format string as a sequence of bytes.

It's probably rare enough for an encoded character to contain a backslash
that no one has changed it yet.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

  • RFC: changing print... Eric Blake via austin-group-l at The Open Group
    • Re: RFC: chang... Chet Ramey via austin-group-l at The Open Group
      • Re: bug#65... Eric Blake via austin-group-l at The Open Group
        • Re: bu... Stephane Chazelas via austin-group-l at The Open Group
          • Re... Eric Blake via austin-group-l at The Open Group
            • ... Stephane Chazelas via austin-group-l at The Open Group
          • Re... Robert Elz via austin-group-l at The Open Group
            • ... Stephane Chazelas via austin-group-l at The Open Group
            • ... Robert Elz via austin-group-l at The Open Group
              • ... Chet Ramey via austin-group-l at The Open Group
      • Re: RFC: c... Oğuz via austin-group-l at The Open Group
        • Re: RF... Stephane Chazelas via austin-group-l at The Open Group
          • Re... Oğuz via austin-group-l at The Open Group
      • Re: bug#65... Eric Blake via austin-group-l at The Open Group
        • Re: bu... Stephane Chazelas via austin-group-l at The Open Group
          • Re... Steffen Nurpmeso via austin-group-l at The Open Group
            • ... Stephane Chazelas via austin-group-l at The Open Group
              • ... Steffen Nurpmeso via austin-group-l at The Open Group
    • Re: bug#65659:... Paul Eggert via austin-group-l at The Open Group
    • Re: RFC: chang... Stephane Chazelas via austin-group-l at The Open Group

Reply via email to