schorfES / node-lintspaces

A validator for checking different kinds of whitespaces in your files.
https://npmjs.com/package/lintspaces
MIT License
30 stars 17 forks source link

UTF-8 charset #35

Closed 807811b0-1373-11e5-b60b-1697f925ec7b closed 7 years ago

807811b0-1373-11e5-b60b-1697f925ec7b commented 7 years ago

EditorConfig has an option for charset = utf-8 but it is not possible to validate this using this package. It would be a useful check. The only valid option for charset would be utf-8.

schorfES commented 7 years ago

Detecting a charset of a file is quite difficult. Files generally indicate their encoding with a file header. However, even reading the header you can never be sure what encoding a file is really using. Maybe there is an npm module out there which can handle the detection of the encoding and lintspaces can use it as dependency, but I didn't see that detection functionality in this project. I'll be fine with a PR to add the charset option.

schorfES commented 7 years ago

I'll close this for now.