-
Notifications
You must be signed in to change notification settings - Fork 28.6k
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
Manage encoding files by extension of filenames #4891
Comments
Currently you can only configure encoding per workspace folder. |
Thank for the quick answer... |
please, |
Any news for files.encoding in extention API or by fileext ? |
I am also affected by this issue. Please fix it. |
@bpasero That didn't fix the issue. We can now change editor.* settings but not the encoding setting. |
I am also affected by this issue. I have many files in the same folders with different encoding... I can't use VSCode because of this. |
I left my volunteer work on VS Code because of this encoding problem that was ignored. cordially |
We also need possibility to set different encoding for different file extensions. Maybe it's possible to write an extension for this? |
to "Somnium7", |
I tried to add
to the settings.json
It is impossible now to set those settings as per language rule, please fix it. VS Code 1.11.2 on Win 10 x64 |
What I find funny is that my old>old editor of choice (Notepad++) is able to auto detect the file encoding and yet VS Code with all its bells and whistles that make it a far better editor can't even manage to do the same. At the very least you would think that we would be able to tell the editor to use X encoding for Y file type. |
This problem is still not solved? It is the biggest miss of Code right now ... Please, take it seriously for a moment. I never lost an afternoon replacing bad chars due a miss while saving a file on Sublime ... |
Guys, you have to vote for the first post (thumb up) so this issue may be taken seriously. With only 2 votes everybody won't care even if it's an annoying issue. |
voted for this issue. |
"files.autoGuessencoding": true worked for me auto detecting win1252 on opening. The changes in @workflo link seem to at least have given a workaround for this issue. |
Voted for this issue. |
Trying to understand the requirements here. So far I have seen various requests to associate a file encoding
It seems to me that being able to define the encoding by path is most powerful because it would allow to define the encoding for particular files in specific folders. And it would also allow to define for all files in all folders of a specific extension. The beauty however of allowing to define the encoding by language is that we already have support for defining settings per language. The syntax is: "[markdown]": {
"editor.wordWrap": "on",
"editor.quickSuggestions": false
} And so I could envision a setting such as: "[markdown]": {
"files.encoding": "some encoding"
} There is another related setting where you can define which extension maps to which language ( The downside of this solution though is that you cannot set the encoding for a subset of files of a language. It would always apply to all files of that language. |
@bpasero I think that defining by path should allow wildcards to be able to match files by extension only. However, it could be harder to implement than detecting by language, because it needs new configuration syntax. For my personal needs, detection by language suffices. Let's see, what other people think. |
I agree with @Somnium7 . Detection by language is the simplest and, at present, the fastest thing to implement. |
I would like to add a fourth alternative to @bpasero's proposal: Emacs also allows overriding other settings like indentation mode, tab width and the like this way. |
I have pushed a change that allows to configure the encoding per language in settings (see #19890 (comment)). Will be available in tomorrows insider release. I think we should see how it goes with this support before we introduce more powerful settings. |
Thank you, Benjamin. |
@FrancisFaure ok to close? |
Hi @bpasero, |
@FrancisFaure yes, the current solution allows to change the encoding for language types. This is possible globally or per workspace folder. |
Hi @bpasero |
@FrancisFaure this is an indirection: multiple extensions can be associated with one language. I suggest you give it a try and report back how it works for you. |
Hi @bpasero |
Hello @bpasero
|
Hi @bpasero, a) I added in my settings (stored in C:\Users\USER\AppData\Roaming\Code - Insiders\User\settings.json):
that work well. b) I removed my settings of §a
and that work ! great ! it's what I needed :) |
works like a bomb |
@bpasero Tested in VSCode version 1.17.0 on Windows 10 |
@bpasero |
@roblourens is aware of that limitation afaik. |
@roblourens Are you (or another person) going to fix this? Maybe a new issue should be created? |
This is the library that would have to support those encodings: https://github.com/hsivonen/encoding_rs It's probably unlikely, as it's not a standard encoding. |
Hello "VS Code" team,
(https://github.com/FrancisFaure/vfp_tmlanguage_generator)
(Visual FoxPro)
users can change all codepage "globally" or codepage on "workspace"
(https://code.visualstudio.com/docs/editor/codebasics#_file-encoding-support)
But in the same directory we can have files in utf8 and others in "Western" (Windows 1252) codepage
I tried to add "files.encoding": "windows1252" in my language pack (package.json) without success..
I googled without solutions
sorry for my bad english
With best regards
Francis
The text was updated successfully, but these errors were encountered: