commitizen icon indicating copy to clipboard operation
commitizen copied to clipboard

`cz ch` cannot decode Chinese word

Open pplmx opened this issue 2 years ago • 1 comments

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

image

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

pplmx avatar Aug 25 '23 02:08 pplmx

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

pplmx avatar Aug 25 '23 03:08 pplmx

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!

Lee-W avatar May 20 '24 20:05 Lee-W