Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wdianjun opened this issue Sep 1, 2022 · 4 comments

Comments

@wdianjun
Copy link

wdianjun commented Sep 1, 2022

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

@Zhengqbbb
Copy link
Contributor

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

@bsor-dev
Copy link

bsor-dev commented Oct 6, 2022

+1

@odGit
Copy link

odGit commented Oct 20, 2022

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.

@simon1uo
Copy link

simon1uo commented Feb 2, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants