commitizen
commitizen copied to clipboard
`cz ch` cannot decode Chinese word
Description
As title
Steps to reproduce
mkdir test; cd test; git init
touch cc
git add cc; git commit -m "feat: 你好, 世界"
cz ch
cat CHANGELOG.md
Current behavior
cannot parse
Desired behavior
parse in the right way
Screenshots
Environment
cz version --report
Commitizen Version: 3.5.3
Python Version: 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)]
Operating System: Windows
If using this, the program even crashed.
mkdir test; cd test; git init
touch cc
git add cc; git commit -m "feat: ハロー・ワールド"
cz ch
cat CHANGELOG.md
error log
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\users\pplmx\.local\bin\cz.exe\__main__.py", line 7, in <module>
File "C:\Users\pplmx\.local\pipx\venvs\commitizen\Lib\site-packages\commitizen\cli.py", line 463, in main
args.func(conf, vars(args))()
File "C:\Users\pplmx\.local\pipx\venvs\commitizen\Lib\site-packages\commitizen\commands\changelog.py", line 193, in __call__
self.write_changelog(changelog_out, lines, changelog_meta)
File "C:\Users\pplmx\.local\pipx\venvs\commitizen\Lib\site-packages\commitizen\commands\changelog.py", line 115, in write_changelog
changelog_file.write(changelog_out)
UnicodeEncodeError: 'gbk' codec can't encode character '\u30fb' in position 45: illegal multibyte sequence
I think this is a duplicate one to https://github.com/commitizen-tools/commitizen/issues/1110. As there's more detail there, let's track this issue there. Thanks for filing the issue!