-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Auto detect ANSI encoding #7048
Comments
@swaner we do not have encoding detection so you need to either configure the encoding globally or per workspace or switch it from the status bar picker. |
I support this issue. I just had a deployment using a script which had ® character inside it and I then edited with Code. And ooh, how the script failed and brought down the system. Simple editors handle ANSI files simply, and Code doesn't. That's a shame. I attach a sample file to test. When I open this file with Code I see � instead of ®, it should leave ® alone. And I tried to change encoding to ANSI, and I couldn't find it among Change File Encoding. Windows 1252 should explicitly say it's ANSI. And Code should automatically understand it's such. |
+1 |
Less powerful alternatives for handling this issue in the short run:
Of course encoding detection would much more powerful. |
It is better to add onOpenFile setEnconding to api extentions... |
I have UTF8 files and I have Windows 1251 files. I can't change it globally to Windows 1251. So every time i open them i have to reopen them. Why, at least, not to save desired encoding per file? If once i opened it in Win1251, open it in Win1251 any time else, unless i reopen or resave it manually as other encoding? And it has western codepages stuck at the top of codepages list rather than local codepages. |
Hi, |
Hi, a friend of mine found a workaround for this "ansi autodetect" problem:
Credits to my friend Marcos Cosmoski Filho. |
This setting has been added: files.autoGuessEncoding Will hopefully be true as default soon; #23417 |
Why only CP1252? I want this for CP1251 too... Someone else will want this for another encoding and so on. I think that you should pick local encoding of this machine. What do you think of it? |
1.1.1
Win 10
Steps to Reproduce:
Result: VSCode assumes UTF-8 and the file is corrupted. Sublime-text has no problem recognizing Windows-1252.
The text was updated successfully, but these errors were encountered: