Skip to content
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

Automatically detect encoding of the file opened #5388

Closed
Zyx-A opened this issue Apr 16, 2016 · 14 comments
Closed

Automatically detect encoding of the file opened #5388

Zyx-A opened this issue Apr 16, 2016 · 14 comments
Assignees
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues
Milestone

Comments

@Zyx-A
Copy link

Zyx-A commented Apr 16, 2016

  • VSCode Version:1.0.0
  • OS Version:6.1.7601 Service Pack 1 Build 7601

Steps to Reproduce:

  1. Use Notepad to save the batch under windows, So Character set is GBK.
  2. open xxx.bat
  3. All chinese text is garbled
@bpasero bpasero added feature-request Request for new features or functionality file-explorer Explorer widget issues labels Apr 17, 2016
@bpasero bpasero added this to the Backlog milestone Apr 17, 2016
@bpasero bpasero changed the title It doesn't automatically recognize the character set Automatically detect encoding of the file opened Apr 17, 2016
@mauriciord
Copy link

Same here. Mac OSX El Captain
VSCode v.1.3.1

When i open a file "Windows 1252", it changes automatically to UTF-8, then i need to reopen as "Windows 1252" and save. If i close the VSCode and open, the files will be "UTF-8"

@joelhy
Copy link

joelhy commented Dec 3, 2016

+1

@dala00
Copy link

dala00 commented Dec 8, 2016

How about adding setEncoding API to VSCode and creating auto detect and changing extension?

@bpasero
Copy link
Member

bpasero commented Dec 18, 2016

Curren status: you always can set a workspace encoding to be used for all files of an opened folder. You can also configure this globally for any files being opened (files.encoding).

Things that would help a lot already is to persist the encoding for particular files when changed from the status bar. This is tracked in #10444

@kzhui125
Copy link

I am using Chinese Simplified Win10 now.
Some of my old cpp and cs files(not many) are ANSI(GBK)-encoding which were created by old version of Visual Studio.
VS can open ANSI files correctly and I can search ANSI(GBK) string through files. With VSCode I have to open file and choose the correct encoding to search.

Notepad++ are more powerful dealing with encodings, it can detect many encodings and open correctly. So I don't need to choose the encoding manually and I can search a string from files mixed with GBK-encoding and BIG5-encoding without opening them, even if the hex-codes of the string are different in GBK and BIG5.

It would be good if vscode could detect encodings, at least ANSI encoding.

@egamma egamma mentioned this issue Dec 29, 2016
56 tasks
@yucaowang
Copy link

Great to see plan/progress on this issue. I agree that auto detecting encoding would be a great help for large projects which may has various encoding for environments difference or historical reasons across thousands of files. Really need this feature +1.

@LiPengfei19820619
Copy link

I expect this issue to appear in the iteration plan.

@wizcas
Copy link

wizcas commented Mar 1, 2017

Why is someone trying to close this issue??
To be honest, auto encoding detection is one of the basic features of a modern editor. VS Code team need to face this issue rather than avoiding it.
Seriously.

@bpasero bpasero self-assigned this Mar 28, 2017
@bpasero
Copy link
Member

bpasero commented Mar 28, 2017

Landed via the new files.autoGuessEncoding setting leveraging the power of jschardet.

@ginlime
Copy link

ginlime commented Mar 28, 2017

+1

File encoding is most important issue for NON-ENGLISH PEOPLE!!
You English people don't know how we non-english people bored for changing encoding when opening file each time...

@bpasero bpasero closed this as completed Mar 28, 2017
@bpasero
Copy link
Member

bpasero commented Mar 28, 2017

If someone wants to verify this, the feature landed in insiders (tomorrows build): #23322

@duanehutchins
Copy link

bpasero, the issue doesn't appear to be resolved in the new build. I replied to that thread with a demo of the persistent bug.

@bpasero
Copy link
Member

bpasero commented Mar 28, 2017

@duanehutchins and I commented. in general I would suggest to report issues into new issues and not closed ones to keep the discussion separate.

@buzzzzer
Copy link

#23322 (comment)

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality file-explorer Explorer widget issues
Projects
None yet
Development

No branches or pull requests