-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Allow to associate a file encoding per file path #23570
Comments
@duanehutchins this is specifically why we introduced the As for your 2 cases I filed aadsm/jschardet#30 and aadsm/jschardet#31 I leave this open to allow to store an encoding for a specific file path. |
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider. If you wonder what we are up to, please see our roadmap and issue reporting guidelines. Thanks for your understanding and happy coding! |
As #30857 was closed as a duplicate of (partially) this and there's a real relevance to be able to set the encoding via file-path (although it likely will work for many to set per workspace, but not all people use the workspace approach and you are not unlikely to have files in the same workspace that use a different encoding): "please reconsider and opening this issue". I guess the biggest point is how to handle conflicting situations (settings in a path vs. file specific extensions). I suggest to give the path specific setting the higher priority but the option to limit it: "files.encoding": "utf8",
"file.encodingPaths": [
{
"pattern": "**/folderA/**",
"encoding": "windows1251"
},
{
"pattern": "**/folderA/subFolder/**",
"encoding": "*"
}
] This way all files in "folderA" would get the windows1251 encoding but the files in "olderA/subFolder" would not have the setting applied (and in this case because of the global setting the utf8 encoding). |
Here is a gif of the bug in action:
TXT Files refrenced: iso-8859-1.txt and shift-jis.txt
Steps to Reproduce:
files.autoGuessEncoding
does not resolve the issue, but it does change which encoding is guessed.Note that if I run
file -bi iso-8859-1.txt
from Git Bash, I can see the correct encoding is returned.The text was updated successfully, but these errors were encountered: