Skip to content

Not work with Cyrillic #1074

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
dbaeumer opened this issue Oct 26, 2017 · 5 comments
Closed

Not work with Cyrillic #1074

dbaeumer opened this issue Oct 26, 2017 · 5 comments

Comments

@dbaeumer
Copy link

dbaeumer commented Oct 26, 2017

From @altaranenco on October 26, 2017 10:43

  • VSCode Version: Code 1.17.2 (b813d12980308015bcd2b3a2f6efa5c810c33ba5, 2017-10-16T13:59:46.104Z)
  • OS Version: Windows_NT x64 10.0.15063
  • Extensions:
Extension Author (truncated) Version
PowerShell ms- 1.4.3

Steps to Reproduce:

  1. Try to load XML file with Cyrillic letters in file name
    $xml = [xml](Get-Content -Encoding UTF8 -Path "C:\MaxPatrol_Reports\Отчет Аудит - Серверы - Сектор ИБ 06.06.2017 11-30-00.xml")
  2. Have an error
Get-Content : Cannot find path 'C:\MaxPatrol_Reports\Отчет Аудит - Серверы - Сектор �Б 06.06.2017 11-30-00.xml' because it does
not exist.
At C:\MaxPatrol_Reports\dataset.ps1:1 char:14
+ ... xml = [xml](Get-Content -Encoding UTF8 -Path "C:\MaxPatrol_Reports\Рћ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\MaxPatrol_Re...17 11-30-00.xml:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
  1. If we run same code at Visual Studio Code x32 or native PowerShell it's work without errors

Reproduces without extensions: Yes/No

Copied from original issue: microsoft/vscode#36975

@TylerLeonhardt
Copy link
Member

Can someone with this issue give this workaround a try that @mklement0 supplied:

$OutputEncoding = [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding

@mklement0
Copy link
Contributor

@tylerl0706: I think in this case the workaround is to ensure that the PS scripts are saved as UTF-8 with BOM:

Click on UTF-8 in the VS Code status bar, choose Save with Encoding, then select UTF-8 with BOM and re-execute the script - see #1392 (comment)

@SydneyhSmith
Copy link
Collaborator

@ghost
Copy link

ghost commented Feb 4, 2021

I tried different encodings for the document and still getting D:\MUSIC>ffmpeg -i "╨е╤А╨╕╤Б╤В╨╕╨╜╨░ ╨б╨╛╨╗╨╛╨▓╤Ц╨╣ - ╨в╤А╨╕╨╝╨░╨╣.m4a" "╨е╤А╨╕╤Б╤В╨╕╨╜╨░ ╨б╨╛╨╗╨╛╨▓╤Ц╨╣ - ╨в╤А╨╕╨╝╨░╨╣.mp3" -n
PowerShell is 💩

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Feb 4, 2021
@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label May 18, 2021
@Alexgolshtein
Copy link

@tylerl0706: I think in this case the workaround is to ensure that the PS scripts are saved as UTF-8 with BOM:

Click on UTF-8 in the VS Code status bar, choose Save with Encoding, then select UTF-8 with BOM and re-execute the script - see #1392 (comment)

This solution definitely works! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants