Skip to content

Commit 438382c

Browse files
committed
Merge pull request godotengine#94006 from alvinhochun/log-file-utf8-fix
Fix UTF-8 misintepreted as Latin-1 when logging to file
2 parents 92880e1 + 5b3857e commit 438382c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/io/logger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ void RotatedFileLogger::logv(const char *p_format, va_list p_list, bool p_err) {
212212
// Strip ANSI escape codes (such as those inserted by `print_rich()`)
213213
// before writing to file, as text editors cannot display those
214214
// correctly.
215-
file->store_string(strip_ansi_regex->sub(String(buf), "", true));
215+
file->store_string(strip_ansi_regex->sub(String::utf8(buf), "", true));
216216
#else
217217
file->store_buffer((uint8_t *)buf, len);
218218
#endif // MODULE_REGEX_ENABLED

0 commit comments

Comments
 (0)