Skip to content

Commit

Permalink
Merge pull request #94006 from alvinhochun/log-file-utf8-fix
Browse files Browse the repository at this point in the history
Fix UTF-8 misintepreted as Latin-1 when logging to file
  • Loading branch information
akien-mga committed Jul 7, 2024
2 parents 92880e1 + 5b3857e commit 438382c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/io/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()`)
// before writing to file, as text editors cannot display those
// correctly.
file->store_string(strip_ansi_regex->sub(String(buf), "", true));
file->store_string(strip_ansi_regex->sub(String::utf8(buf), "", true));
#else
file->store_buffer((uint8_t *)buf, len);
#endif // MODULE_REGEX_ENABLED
Expand Down

0 comments on commit 438382c

Please sign in to comment.