bug-coreutils
[Top][All Lists]
Advanced

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

bug#66698: I think hex decoding with basenc -d --base16 should be case-i


From: Pádraig Brady
Subject: bug#66698: I think hex decoding with basenc -d --base16 should be case-insensitive
Date: Mon, 23 Oct 2023 14:08:17 +0100
User-agent: Mozilla Thunderbird

On 23/10/2023 13:50, Niels Möller wrote:
Pádraig Brady <P@draigBrady.com> writes:

Will apply the attached later.
Marking this as done.

Thanks! It would make some sense to me to also have options
--upper/--lower; on encoding, they would specify case of the output, on
decoding, they would reject the other case (with default being to accept
either). But less important than fixing the default behavior.

I was thinking `tr '[:lower:]' '[:upper:]'` would suffice for that when 
encoding.
When decoding I don't see much need for the strictness, but that could
also be enforced easily by prefiltering with something like `tr 'A-F' x`

The same argument could be made of course for not needing this patch at all,
by prefiltering through tr.  However the default operation should be the
most common requirement (and also the RFC documented operation in this case).
A similar case I hit very frequently is pasting hex into bc, and it's
very annoying to have to convert to uppercase before doing this.

+  basenc --base16 -d no supports lower case hexadecimal characters.
+  Previously an error was given for lower case hex digits.

s/ no / now /

Thanks, pushed.

Pádraig.






reply via email to

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