cz-cli icon indicating copy to clipboard operation
cz-cli copied to clipboard

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

Open wdianjun opened this issue 3 years ago • 4 comments

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

wdianjun avatar Sep 01 '22 15:09 wdianjun

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

Zhengqbbb avatar Sep 20 '22 15:09 Zhengqbbb

+1

bsor-dev avatar Oct 06 '22 06:10 bsor-dev

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.

odGit avatar Oct 20 '22 13:10 odGit

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

simon1uo avatar Feb 02 '24 07:02 simon1uo