diff --git a/mmengine/logging/logger.py b/mmengine/logging/logger.py index 839a08cdda..ba52e60db9 100644 --- a/mmengine/logging/logger.py +++ b/mmengine/logging/logger.py @@ -258,7 +258,7 @@ def __init__(self, # change the file mode to the default behavior. # `FileHandler` is not supported to have colors, # otherwise it will appear garbled. - file_handler = logging.FileHandler(log_file, file_mode) + file_handler = logging.FileHandler(log_file, file_mode, encoding='utf-8') # `StreamHandler` record year, month, day hour, minute, # and second timestamp. file_handler will only record logs