Merge pull request #94006 from alvinhochun/log-file-utf8-fix
Fix UTF-8 misintepreted as Latin-1 when logging to file
This commit is contained in:
commit
438382cdc2
|
@ -212,7 +212,7 @@ void RotatedFileLogger::logv(const char *p_format, va_list p_list, bool p_err) {
|
||||||
// Strip ANSI escape codes (such as those inserted by `print_rich()`)
|
// Strip ANSI escape codes (such as those inserted by `print_rich()`)
|
||||||
// before writing to file, as text editors cannot display those
|
// before writing to file, as text editors cannot display those
|
||||||
// correctly.
|
// correctly.
|
||||||
file->store_string(strip_ansi_regex->sub(String(buf), "", true));
|
file->store_string(strip_ansi_regex->sub(String::utf8(buf), "", true));
|
||||||
#else
|
#else
|
||||||
file->store_buffer((uint8_t *)buf, len);
|
file->store_buffer((uint8_t *)buf, len);
|
||||||
#endif // MODULE_REGEX_ENABLED
|
#endif // MODULE_REGEX_ENABLED
|
||||||
|
|
Loading…
Reference in New Issue