r/cpp • • Jun 26 '26

Improvements to std::format in C++26

https://mariusbancila.ro/blog/2026/06/19/improvements-to-stdformat-in-c26/
91 Upvotes

38 comments sorted by

View all comments

Show parent comment

1

u/rdtsc Jun 27 '26

Sure it might be legacy, doesn't change the fact that it is used for all double-quoted strings on Windows. If you want UTF-8 use u8"" and char8_t. Converting L"ä" I get "\xE4". Formatting path(L"ä") to "\xC3\xA4" would be unexpected/surprising, incompatible with other strings, and result in garbled text when the string is then displayed.

2

u/aearphen {fmt} Jun 27 '26

ACP is actually only used in the legacy Windows APIs (which shouldn't be used in modern code) but virtually unused in standard C++ APIs.