commitizen / cz-cli

The commitizen command line utility. #BlackLivesMatter

Home Page:http://commitizen.github.io/cz-cli/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The config file at "C:\Users\lenovo\.czrc" contains invalid charset, expect utf8

wdianjun opened this issue · comments

安装使用git commit规范 使用命令git cz 为什么会报这个错误?求解

utf8!!!删除根目录下的.czrc,在vscode中新建.czrc文件

{ "path": "cz-git" }

https://cz-git.qbb.sh/zh/guide/#%E5%85%A8%E5%B1%80%E4%BD%BF%E7%94%A8

commented

+1

The issue is not with commitizen, but with CLI (in my case PowerShell) it was not setting utf-8 encoding of the .czrc file.
I have had the same issue on Windows 10 in PowerShell (PSVersion: 5.1.19041.1682).

The following solved the encoding issue for me:

'{ "path": "cz-conventional-changelog" }' | Add-content -Encoding UTF8 -Path ~/.czrc

Note: I am using commitizen as a global utility with the .czrc file in the "root" directory.

使用 vscode 编辑一下,保存的时候修改成 utf8 编码格式就好了