Color formatting fixed for wide strings (fixes issue #1594) (#1596)

* Use std::char_traits::length for ansi_color_escape::begin

-Fixes issue #1594 https://github.com/fmtlib/fmt/issues/1594
This commit is contained in:
Spirrwell
2020-03-17 09:24:42 -04:00
committed by GitHub
parent 026f99178e
commit 2559983e7a
2 changed files with 3 additions and 1 deletions

View File

@@ -412,7 +412,7 @@ template <typename Char> struct ansi_color_escape {
FMT_CONSTEXPR const Char* begin() const FMT_NOEXCEPT { return buffer; }
FMT_CONSTEXPR const Char* end() const FMT_NOEXCEPT {
return buffer + std::strlen(buffer);
return buffer + std::char_traits<Char>::length(buffer);
}
private: