소스 검색

Fix UTF-8 misintepreted as Latin-1 when logging to file

Alvin Wong 1 년 전
부모
커밋
5b3857e5f1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      core/io/logger.cpp

+ 1 - 1
core/io/logger.cpp

@@ -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