Skip to content

Support fmt::runtime with wchar_t in fmt::format_to_n#4715

Open
sunmy2019 wants to merge 4 commits intofmtlib:masterfrom
sunmy2019:gh-4714
Open

Support fmt::runtime with wchar_t in fmt::format_to_n#4715
sunmy2019 wants to merge 4 commits intofmtlib:masterfrom
sunmy2019:gh-4714

Conversation

@sunmy2019
Copy link
Contributor

resolves #4714

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. We shouldn't modify base.h for this.

@sunmy2019
Copy link
Contributor Author

Thanks for the PR. We shouldn't modify base.h for this.

How about reimplementing similar functions in xchar.h?

@vitaut
Copy link
Contributor

vitaut commented Mar 15, 2026

I think what we need here as an overload of format_to_n that takes wformat_string in xchar.h. Existing runtime format string machinery should take care about the rest as it already does for other overloads.

@n0lavar
Copy link

n0lavar commented Mar 15, 2026

what about char16_t?

@vitaut
Copy link
Contributor

vitaut commented Mar 15, 2026

Let's focus on wchar_t in this PR.

@sunmy2019
Copy link
Contributor Author

Let's focus on wchar_t in this PR.

I use wformat_string in the new implementation. This may remove previous support of char type not in char, wchar. Tell me if it is not desired.

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.

std::format_to_n() doesn't work with wchar_t and fmt::runtime()

3 participants