CodeWiki icon indicating copy to clipboard operation
CodeWiki copied to clipboard

Non-UTF-8 encoded Chinese characters in subprocess output on Windows cause a crash.

Open tianzj opened this issue 6 months ago • 2 comments

In codewiki's str_replace_editor.py, the .decode() calls on subprocess output crash when encountering GBK-encoded Chinese characters on Windows.

tianzj avatar May 15 '26 10:05 tianzj

I’m seeing a similar issue on Windows: when CodeWiki reads or writes files using Python’s open() without explicitly specifying encoding="utf-8", it can fail with UnicodeEncodeError or UnicodeDecodeError if the generated documentation contains emojis or other non-ASCII characters.

A possible fix is to use:

open(path, "r", encoding="utf-8", errors="replace") open(path, "w", encoding="utf-8")

haddad-me avatar May 19 '26 09:05 haddad-me

Fixed in 3ab1b98.

anhnh2002 avatar May 23 '26 13:05 anhnh2002