Skip to content

Characters like "ä/ü/ö" don't get saved right #3010

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

Closed
modzilla99 opened this issue Oct 14, 2020 · 5 comments
Closed

Characters like "ä/ü/ö" don't get saved right #3010

modzilla99 opened this issue Oct 14, 2020 · 5 comments
Labels
Resolution-Answered Will close automatically.

Comments

@modzilla99
Copy link

System Details

Windows 10 Pro 2004
VSCode 1.50.0
[email protected]

System Details Output

### VSCode version: 1.50.0 93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3 x64

### VSCode extensions:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]


### PSES version:

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      5.1.19041.546
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.546
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

When writing characters like ä,ü,ö and saving the file, those characters will become corrupted. If you then open the file in PS IDE you can see it, even though they're still displayed fine in vscode (even after reopening). When replacing them in PS IDE they'll be replaced with � in vscode. Butt executing the script shows that they are set correctly now. I attached 2 powershell documents to show it off, one's been edited with powershell IDE and one with vscode.

Expected Behaviour

Saving the file won't result in ä,ö,ü getting replaced by different characters

Actual Behaviour

'ä' for eg. will be replaced by 'ä' and 'Ä' with 'Ä'. The latter is obviously particularly bad as it hinders your script from running.

Attached Logs

Powershell-Logs.zip
Saved-Scripts.zip

@ghost ghost added the Needs: Triage Maintainer attention needed! label Oct 14, 2020
@rjmholt
Copy link
Contributor

rjmholt commented Oct 14, 2020

Please take a look at this doc that we wrote about configuring your editor encoding correctly

@TylerLeonhardt TylerLeonhardt added Needs-Repro-Info and removed Needs: Triage Maintainer attention needed! labels Oct 15, 2020
@modzilla99
Copy link
Author

Thank you! It's now solved with windows-1252 encoding!
It would be great to make that more obvious though! I already thought that it might be the cause but since UTF-8 was already ticked...

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Oct 16, 2020
@rjmholt
Copy link
Contributor

rjmholt commented Oct 16, 2020

It would be great to make that more obvious though!

Yeah, it would be nice to help users preempt encoding issues, it's just hard to (1) detect that they are issues and (2) hard to notify the user in an appropriate way given that the extension just sits between VSCode (which controls the file encoding) and PowerShell (which controls the parse encoding). Some followup questions:

  • What in particular would you like made more obvious?
  • Where would you expect such a communication about encoding in the VSCode/PowerShell experience?

@rjmholt rjmholt added Resolution-Answered Will close automatically. and removed Needs-Repro-Info Needs: Maintainer Attention Maintainer attention needed! labels Oct 16, 2020
@ghost ghost closed this as completed Oct 17, 2020
@modzilla99
Copy link
Author

Thank you for caring! Hm that's a good question. I think I would like to get a small notification that contains a link to the docs when you start to type special characters and haven't changed anything in terms of encoding. Or maybe do it like you do with echo and cd. If that's in your code you'll get asked to change it to Write-Host or Set-Location respectively. Hope this helps a little

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Oct 18, 2020
@rjmholt
Copy link
Contributor

rjmholt commented Oct 19, 2020

Ah interesting. Now that I think about it, I suspect the best way for us to surface this is with a PSScriptAnalyzer rule actually. See PowerShell/PSScriptAnalyzer#1436.

@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Dec 8, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Answered Will close automatically.
Projects
None yet
Development

No branches or pull requests

4 participants