Skip to content

Handle long localized time strings - #5056

Open
yss25 wants to merge 1 commit into
fmtlib:mainfrom
yss25:codex/fix-long-locale-time
Open

yss25 wants to merge 1 commit into
fmtlib:mainfrom
yss25:codex/fix-long-locale-time

Conversation

@yss25

@yss25 yss25 commented Dec 2, 2026

Copy link
Copy Markdown

The locale conversion buffer holds only 32 code units. A std::time_put facet that emits a longer valid string makes fmt::format(loc, "{:L%c}", tm) throw failed to format time.

Size the conversion buffer for the input while keeping 32 code units inline. Add tests at the old limit and beyond it, plus a long wide-string conversion.

The new public-API test fails on the original code and passes with the fix. Both new tests pass on MSVC 19.44. The full suite passes 20/22 CTests, with the same two locale-dependent failures (chrono_test.locale and unicode_test.legacy_locale) as the unmodified baseline on this Windows machine.

@yss25
yss25 requested a review from vitaut as a code owner December 2, 2026 16:48
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.

1 participant