mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-04 17:26:42 +00:00
Clarify encoding conversion in chrono
This commit is contained in:
parent
6f435f55c8
commit
4a617f25c6
@ -774,6 +774,8 @@ OutputIt format_duration_unit(OutputIt out) {
|
||||
if (const char* unit = get_units<Period>()) {
|
||||
string_view s(unit);
|
||||
if (const_check(std::is_same<Char, wchar_t>())) {
|
||||
// This works when wchar_t is UTF-32 because units only contain code
|
||||
// points that have the same values in UTF-16 and UTF-32.
|
||||
utf8_to_utf16 u(s);
|
||||
return std::copy(u.c_str(), u.c_str() + u.size(), out);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user