-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
date:UTF-8 checks exist to keep custom date formats binary-safe #9972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
GNU testsuite comparison: |
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.
|
i think something went wrong with the stack of commits |
|
GNU testsuite comparison: |
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
|
GNU testsuite comparison: |
new OutputEncoding enum, byte-preserving helpers, and UTF-8 checks exist to keep custom date formats binary-safe.
related
#9959