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.