bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: \U expansion in single-byte locale


From: Chet Ramey
Subject: Re: \U expansion in single-byte locale
Date: Mon, 29 May 2023 13:16:41 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 5/26/23 3:44 AM, Grisha Levit wrote:
If expanding a \u (or \U) escape sequence fails, Bash replaces the
input escape sequence with a newly generated one:

$ LC_ALL=C printf %b \\U80
\u0080

Bash normalizes to a consistent result across printf/echo/$''.


Since this new sequence may by longer than the input, it can cause an
overflow in printf:

Thanks, this should use the same logic as ansicstr(), since it ends up
calling the same translation functions.

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]