Skip to content

Conversation

@mattsu2020
Copy link
Contributor

new OutputEncoding enum, byte-preserving helpers, and UTF-8 checks exist to keep custom date formats binary-safe.

related
#9959

@github-actions
Copy link

github-actions bot commented Jan 1, 2026

GNU testsuite comparison:

Congrats! The gnu test tests/shuf/shuf-reservoir is no longer failing!
Congrats! The gnu test tests/sort/sort-stale-thread-mem is no longer failing!

Implement support for preserving byte sequences in date command output when dealing with invalid UTF-8 in format arguments or formatted strings. This prevents failures on non-UTF-8 data, especially on Unix systems, by introducing OutputEncoding enum (Utf8/BytePreserving), updating format parsing to use OsString, and adding write_formatted_output function. Addresses issues with binary-safe output in custom date formats.
Moved the ShortcutValueParser import after the unix-specific import to better organize platform-specific and general imports in date.rs.
Add #[cfg_attr(not(unix), allow(dead_code))] to OutputEncoding::BytePreserving,
CustomFormatError::InvalidUtf8, locale_output_encoding(), and decode_byte_preserving()
to allow these items to be unused on non-Unix systems without triggering warnings.
This improves code quality and reduces noise in builds on unsupported platforms.
@sylvestre
Copy link
Contributor

i think something went wrong with the stack of commits

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/shuf/shuf-reservoir (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/sort/sort-stale-thread-mem (passes in this run but fails in the 'main' branch)

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 14, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing mattsu2020:date_9959 (e432176) with main (6b49ff9)1

Summary

✅ 141 untouched benchmarks
⏩ 38 skipped benchmarks2

Footnotes

  1. No successful run was found on main (8be7ca5) during the generation of this report, so 6b49ff9 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 38 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/sort/sort-float is no longer failing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants