xltrail / git-xl

Git extension: Makes git-diff work for VBA in Excel workbooks (xls* file types)

Home Page:https://www.xltrail.com/git-xl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Claasic ‘gbk’ encoding issues for Windows

RaidOpe opened this issue · comments

I checked colorama's problem description. It seems that colorama uses ASCII decoding for stdout,
Invalid unicode string handling

When diff.py is executed, collecting the modified information can work, but ultimately cannot be decoded to stdout. It is assumed here that before colorama init, determine utf-8stdout

if sys.stdout.encoding.lower() != 'utf-8':
    sys.stdout = open(sys.stdout.fileno(), mode='w', encoding='utf-8', buffering=1)

I look forward to your reply and point out my mistakes.

UnicodeEncodeError: 'gbk' codec can't encode character '\ufffd' in position 19: illegal multibyte sequence [34980] Failed to execute script 'diff' due to unhandled exception! fatal: external diff died, stopping at dd.xlsm

This is about #64 so ideally, you'd add your comment there.