Skip to content

[windows] enforce to use UTF-8 #788

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

Open
2 tasks
indraraj26 opened this issue Sep 15, 2019 · 4 comments
Open
2 tasks

[windows] enforce to use UTF-8 #788

indraraj26 opened this issue Sep 15, 2019 · 4 comments

Comments

@indraraj26
Copy link

When i create manually commitlint.config.js then i paste module.exports = {extends: ['@commitlint/config-conventional']} then it is taking UTF-8

Expected Behavior

Is there any way to force echo command to use UTF-8, if it is not possible you can close this.

Current Behavior

When you execute below in windows it will always be in different encoding instead of UTF-8
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js

Affected packages

  • [x ] cli
  • core
  • prompt
  • [x ] config-angular

Possible Solution

Steps to Reproduce (for bugs)

  1. execute this in windows
    echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js

  2. check the encoding.

commitlint.config.js ```js ```

Context

Your Environment

Executable Version
commitlint --version VERSION
8.1.0
git --version VERSION
git version 2.19.1.windows.1
node --version VERSION
v10.16.0

Thank you

@marionebl
Copy link
Contributor

I personally don't use win32 at all so I am not sure how to achieve this (as I can't test proposed solutions). According to Stackoverflow there is the chcp command to change cmd.exe output to utf-8.

I think the appropriate fix for this would be to add a win32-specific setup step detailing this. Want to lend a hand and test if this fixes the issue?

@indraraj26
Copy link
Author

Hi, I have tried stackoverflow post but still default encoding type is ANSI, I checked with save-as in notepad to check encoding type.

image

I think let user generate commitlint.config.js by themselves.

@marionebl
Copy link
Contributor

I think let user generate commitlint.config.js by themselves.

Good idea - the adapted section for win32 users still applies.

@indraraj26
Copy link
Author

Hi @marionebl , You can close this thread once you added description in docs.

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

No branches or pull requests

2 participants