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

Wrongly guess encoding as Windows 1252 or ISO-8859-2 #27419

Closed
bric3 opened this issue May 29, 2017 · 5 comments
Closed

Wrongly guess encoding as Windows 1252 or ISO-8859-2 #27419

bric3 opened this issue May 29, 2017 · 5 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) file-encoding File encoding type issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@bric3
Copy link

bric3 commented May 29, 2017

  • VSCode Version: Version 1.12.2 (1.12.2)
    19222cdc84ce72202478ba1cec5cb557b71163de
  • OS Version: macOS Sierra 10.12.5 (16F73)

Steps to Reproduce:

  1. Creates a YAML file, with some french text, make sure it is saved it as utf8

    property:
      summary: "Spécifications Swagger"
  2. Make sure the default encoding is utf8 in the settings.json

        "files.autoGuessEncoding": true,
        "files.encoding": "utf8",
    
  3. Reopen the file, guessed encoding is Windows 1252. Another side effect is that the line with accents is marked as modified as soon as the file is opened

    prop:
      summary: "Spécifications Swagger"

The only workaround is to reopen the file with a different encoding, which is cumbersome when you work with a load of files.

If the same text, encoded as UTF-8, is saved in other file extensions, reopening this file show guesses with different encodings, like ISO-8859-2.

I have files with different encoding, so I'd like vscode to guess from content, but here vscode zealously try other encodings while UTF-8 works and is the default encoding. Did I miss something, or is something misconfigured ?

@bpasero
Copy link
Member

bpasero commented May 29, 2017

We should report this to the encoding detection library we are using: https://github.com/aadsm/jschardet/issues

@bpasero bpasero added file-explorer Explorer widget issues upstream Issue identified as 'upstream' component related (exists outside of VS Code) labels May 29, 2017
@bpasero bpasero added this to the Backlog milestone May 29, 2017
@bpasero bpasero added file-io File I/O file-encoding File encoding type issues and removed file-explorer Explorer widget issues file-io File I/O labels Nov 13, 2017
@bpasero bpasero removed this from the Backlog milestone Nov 16, 2017
@gingerbeardman
Copy link

it sucks that the unmaintained https://github.com/aadsm/jschardet/ is causing encoding features to be blocked.

@irudoy
Copy link

irudoy commented Apr 1, 2018

Encoding-related issues and pull requests have a low priority, and most likely will never be implemented because the VSCode team does not face problems in working with non-UTF8 codebases. They think that the whole world is in UTF8 😄🧐😏😫🤢💩🤞👩‍💻🐱🔚🕦🇯🇵🇨🇳🇷🇺ض⎛. Other encodings are not used in any project. This is about the same as to think that all people have the hands and feet. That everyone can see and hear sounds.

@gingerbeardman
Copy link

gingerbeardman commented Apr 1, 2018

Well said... or that everybody in the world speaks American English.

@bpasero
Copy link
Member

bpasero commented Sep 11, 2018

I am merging this into #33720 which has more upvotes and talks about the same underlying issue of wrongly guessing windows-1252 as encoding.

@bpasero bpasero closed this as completed Sep 11, 2018
@bpasero bpasero added the *duplicate Issue identified as a duplicate of another issue(s) label Sep 11, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) file-encoding File encoding type issues upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants