From 370f5356a1103d84fff194c6192912bb42fa985d Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Wed, 19 Jun 2019 12:34:16 +0200 Subject: [PATCH] Move "character has no narrow representation" to flog This was a warning, which is kind of ridiculous, as it's inactionable error spew. Fixes #2815. --- src/common.cpp | 4 ++-- src/flog.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common.cpp b/src/common.cpp index 1a7c7aa89..3d418657d 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -414,7 +414,7 @@ std::string wcs2string(const wcstring &input) { std::memset(converted, 0, sizeof converted); size_t len = std::wcrtomb(converted, wc, &state); if (len == (size_t)-1) { - debug(1, L"Wide character U+%4X has no narrow representation", wc); + FLOGF(char_encoding, L"Wide character U+%4X has no narrow representation", wc); std::memset(&state, 0, sizeof(state)); } else { result.append(converted, len); @@ -452,7 +452,7 @@ static char *wcs2str_internal(const wchar_t *in, char *out) { } else { size_t len = std::wcrtomb(&out[out_pos], in[in_pos], &state); if (len == (size_t)-1) { - debug(1, L"Wide character U+%4X has no narrow representation", in[in_pos]); + FLOGF(char_encoding, L"Wide character U+%4X has no narrow representation", in[in_pos]); std::memset(&state, 0, sizeof(state)); } else { out_pos += len; diff --git a/src/flog.h b/src/flog.h index 56d70038a..0a97e55fb 100644 --- a/src/flog.h +++ b/src/flog.h @@ -71,6 +71,7 @@ class category_list_t { category_t env_export{L"env-export", L"Changes to exported variables"}; category_t topic_monitor{L"topic-monitor", L"Internal details of the topic monitor"}; + category_t char_encoding{L"char-encoding", L"Character encoding issues"}; }; /// The class responsible for logging.