Skip to content

Commit

Permalink
Merge pull request #4415 from bruntib/plaintext_encoding
Browse files Browse the repository at this point in the history
[fix] Proper encoding of standard output
  • Loading branch information
bruntib authored Jan 21, 2025
2 parents 0a96fee + 6aaa279 commit b7ab4af
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# -------------------------------------------------------------------------
""" Helper and converter functions for plain text format. """

import locale
import logging
import math
import os
Expand Down Expand Up @@ -176,7 +177,9 @@ def convert(
if source_comment and source_comment.line:
output.write(f"{source_comment.line.rstrip()}\n")

output.write(f"{format_main_report(report)}")
output.write(
f"{format_main_report(report)}"
.encode('utf-8').decode(locale.getlocale()[1] or "utf-8"))
else:
output.write(InvalidFileContentMsg)

Expand Down

0 comments on commit b7ab4af

Please sign in to comment.