-
Notifications
You must be signed in to change notification settings - Fork 513
Incorrect handling of Umlaut when debugging with PowerShell Extension #1744
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
Comments
Thanks @MarcusLerch this seems like the same issue as #1680 |
This occurs because your PowerShell encoding and VSCode encoding are not configured the same way; your script file is encoded in UTF8 and PowerShell is trying to read it in Latin-1 which is a setting that the PowerShell extension cant see or change. Can you try this #1680 (comment) and let us know if it works for you? |
@SydneyhSmith that is actually fixing the problem. If I manually set the file to UTF8 Encoding debugging and running gives the same correct output. VSCode opened the file as UTF8 with BOM which then produces the error. |
@MarcusLerch would you be able to share the output of My reasoning is:
|
@rjmholt sure, here you go
Taken from the VSCode PowerShell Terminal. |
Just tried to reproduce the behavior and @rjmholt you are correct.
|
Yeah I thought this might be the case -- basically the PowerShell tokenizer will detect the BOM and reconfigure itself. The .NET When there's no BOM, PowerShell assumes by default that the encoding is latin-1/CP-1252 and that's when things break. You can try to configure PowerShell's encoding (@rkeithhill being a StackOverflow legend as always!), but in versions prior to 6, trying to get PowerShell to keep and honour your encoding settings is quite a dance. So a BOM is the easiest way to be sure. PowerShell 6+ defaults to UTF-8 without a BOM (but will happily accept a BOM as well), so you'll likely find this isn't a problem in PowerShell 6+. |
Issue Type: Bug
debugging this code
in VSCode with PowerShell Extension, incorrectly throws the following exceptions:
However the code runs fine in PowerShell and debugs correct in ISE.
Extension version: 1.11.0
VS Code version: Code 1.30.2 (61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8, 2019-01-07T22:54:13.295Z)
OS version: Windows_NT x64 10.0.17763
System Info
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: