coreutils/tests
Andrew Liebenow 961a27acff printf: accept non-UTF-8 input in FORMAT and ARGUMENT arguments
Other implementations of `printf` permit arbitrary data to be passed
to `printf`. The only restriction is that a null byte terminates
FORMAT and ARGUMENT argument strings (since they are C strings).

The current implementation only accepts FORMAT and ARGUMENT
arguments that are valid UTF-8 (this is being enforced by clap).

This commit removes the UTF-8 validation by switching to OsStr
and OsString.

This allows users to use `printf` to transmit or reformat null-safe
but not UTF-8-safe data, such as text encoded in an 8-bit text
encoding. See the `non_utf_8_input` test for an example (ISO-8859-1
text).

[drinkcat: also squashed in this commit to ease rebase]
Author: Justin Tracey <jdt.dev@unsuspicious.click>

uucore, printf: improve non-UTF-8 format arguments

This fixes handling of format arguments, in part by eliminating duplicate
implementations. Utilities with format arguments other than printf will no
longer accept things like "'a" as numbers, etc.

Co-authored-by: Justin Tracey <jdt.dev@unsuspicious.click>
2025-07-16 00:28:34 +02:00
..
benches/factor chore: cleanup unused dependencies 2025-07-02 19:47:23 -04:00
by-util printf: accept non-UTF-8 input in FORMAT and ARGUMENT arguments 2025-07-16 00:28:34 +02:00
fixtures tests/fold: add tests for non-utf8 streams 2025-06-22 20:57:19 -06:00
uutests uutests: improve error message for non-empty stderr 2025-07-10 14:54:02 +02:00
test_util_name.rs fix: Add test for main binary version information output 2025-06-10 20:36:17 +02:00
tests.rs uutests: fix the doc 2025-03-29 09:28:54 +01:00