-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Langauge Specific file encoding setting #19890
Comments
Note that this does not appear to be a duplicate of #10444, since this issue is about being able to set the encoding on a language-specific basis in config so that files never opened before will be opened with the specified encoding. |
@rmunn - that is correct. This request is for files that have not been opened before. It would be nice if this was something that a plugin could also set the defaults for in their own settings as I have a custom plugin I made for the language I'm using. It would be doubly cool if I could set the encodings different for different file extensions within a language configuration, but that might be a bit out of scope or too difficult to manage. |
The following syntax is now supported in settings: {
"[language id]": {
"files.encoding": "any encoding"
}
} Note: due to the nature of this setting applying on file reading, it is not possible to assign the encoding for languages who define their kind through the first line of the text content. This only works by looking at the path of the file to determine its file association. |
@bpasero - you listed the syntax for the main launguage id in the main settings, does that mean it's also able to be set in the language specific settings of a plugin that adds a new language? |
@Sleaker yes! "configurationDefaults": {
"[language id]": {
"files.encoding": "any encoding"
}
} |
Ability to set default file encoding on a per-language basis.
I have files for older programming languages that I need to open with Codepage 852 or 437 but I can't set the default file encoding on a per language basis. These files are not in self-contained repositories so setting a workspace-wide setting doesn't work, and for the most part everything else is UTF. I'd like to be able to add a setting in the language configuration to open a file with specific encoding by default and override the workspace ##default.
The text was updated successfully, but these errors were encountered: