Skip to content

Commit

Permalink
fix console encoding on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Johann committed Oct 7, 2020
1 parent 8cbdab9 commit 9c1e267
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions resources/scripts/lazpaint/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
if input('') != chr(27) + 'LazPaint':
print("Needs to be run from LazPaint.")
exit()

import sys
if sys.platform == "win32":
import io
sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding = 'utf-8')
sys.stderr = io.TextIOWrapper(sys.stderr.detach(), encoding = 'utf-8')
sys.stdin = io.TextIOWrapper(sys.stdin.detach(), encoding = 'utf-8')

def parse_str(text: str):
if text[:1] == "#":
Expand Down

0 comments on commit 9c1e267

Please sign in to comment.