-
Notifications
You must be signed in to change notification settings - Fork 29.1k
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
Wrong guess encoding as Windows 1252 #33720
Comments
I have same problem with utf8 and iso88591. |
I had same problem. Please try Insiders. |
Well I tried on 1.17 and still happens. On my case a blank txt file with some word with accents even saving with UTF-8 still reopens with Western 1252 or ISO 8859-2. |
Sorry. not fixed by 1.17.0. |
Still not fixed in 1.23:
Ellipsis symbol |
Any updates? I'm still getting this issue today. |
Could the fix in this issue #23997 lead to regression? |
The code from latin1prober.js:113 looks very suspicious this.getCharsetName = function() {
return "windows-1252";
} It's the cause of the problem. For those of you who are interested in debugging here is a snippet: const detect = require("./init").detect
const fs = require('fs')
let args = []
process.argv.forEach(v => args.push(v))
let fname = args[2]
let buf = fs.readFileSync(fname)
console.log(detect(buf)) Place it to src/tst.js. To run call |
Same issue here... |
It happens to me when there is a copyright symbol in the file. VSCode incorrectly guesses Windows-1252, which shows an invalid character next to the copyright symbol. |
omg, Hard to believe that this problem actually existed for so long, 1.40.2 Still not fixed... |
How to upvote? |
@JulioNobre I get that may be ambiguous to identify the exact encoding, but something has to be done, even that does not involve a Microsoft code directly. Try to create a blank txt file with the Windows-1252 encoding and write the word "coração". Now open the file, and you still see that even something aparently simple and created by Code, the guessed encoding still wrong. I tried to simulate this on multiple Text Editors, and no one opened the file with wrong encoding. I also testd with ISO 8859-1, same issue. So this is a problem, because if the application offers the options to save with multiple encoding, it should at least open the file created with the same encoding, otherwise don't offer certain encoding options. |
VSCode 1.41.0 Still not fixed... |
still not fixed, version 1.42.1 |
although i got it working with a workaround: in my "files.encoding": "utf8",
"files.autoGuessEncoding": false |
|
This only has sense if your whole project is encoded as UTF-8 |
Still experiencing this problem. |
People, on the 29th of May we have had this issue open for 1000 days. Celebrate... 🍰 |
1002 today.. |
This issue originally describes this bug: aadsm/jschardet#56, which should be fixed by aadsm/jschardet#57 and aadsm/jschardet#59. |
I think this newest release solves this issue: https://github.com/aadsm/jschardet/releases/tag/v2.2.1 |
We can pick up a new version for July, as we are currently closing for June endgame. |
Upstream issue: aadsm/jschardet#48
Steps to Reproduce:
settings.json
of my vscodeutf-8
test1.txt
test2.txt
test1.txt
guessed encoding isWindows 1252
andtest2.txt
guessed encoding isutf-8
.Reproduces without extensions: Yes
The text was updated successfully, but these errors were encountered: