mirror of
https://github.com/fmtlib/fmt.git
synced 2025-11-27 04:39:44 +01:00
Fix formatting of exotic characters
This commit is contained in:
@@ -771,7 +771,7 @@ FMT_MAKE_VALUE(uint_type, unsigned char, unsigned)
|
||||
template <typename C, typename Char,
|
||||
FMT_ENABLE_IF(std::is_same<typename C::char_type, Char>::value)>
|
||||
FMT_CONSTEXPR init<C, int, char_type> make_value(Char val) {
|
||||
return val;
|
||||
return {val};
|
||||
}
|
||||
|
||||
template <typename C,
|
||||
|
||||
@@ -2025,7 +2025,7 @@ template <typename Char, typename Handler>
|
||||
FMT_CONSTEXPR const Char* parse_precision(const Char* begin, const Char* end,
|
||||
Handler&& handler) {
|
||||
++begin;
|
||||
auto c = begin != end ? *begin : 0;
|
||||
auto c = begin != end ? *begin : Char();
|
||||
if ('0' <= c && c <= '9') {
|
||||
handler.on_precision(parse_nonnegative_int(begin, end, handler));
|
||||
} else if (c == '{') {
|
||||
@@ -2763,8 +2763,9 @@ template <typename Range> class basic_writer {
|
||||
auto&& it = reserve(1);
|
||||
*it++ = value;
|
||||
}
|
||||
void write(wchar_t value) {
|
||||
static_assert(std::is_same<char_type, wchar_t>::value, "");
|
||||
|
||||
template <typename Char, FMT_ENABLE_IF(std::is_same<Char, char_type>::value)>
|
||||
void write(Char value) {
|
||||
auto&& it = reserve(1);
|
||||
*it++ = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user