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

problem with non english characters in the path #670

Closed
fuglphoenix opened this issue Apr 20, 2021 · 6 comments
Closed

problem with non english characters in the path #670

fuglphoenix opened this issue Apr 20, 2021 · 6 comments
Labels
🐛 bug Something isn't working powershell

Comments

@fuglphoenix
Copy link

fuglphoenix commented Apr 20, 2021

Prerequisites

  • [ yes] I have read and understand the CONTRIBUTING guide
  • [ yes] I looked for duplicate issues before submitting this one

Description

it doesn't like it when there is non english characters in the path

Environment

  • Oh my Posh version: 3.140.0

  • Operating System: windows 10 build 19043

  • Shell: powershell 7.1.3

  • Terminal: windows terminal

Steps to Reproduce

  1. have a non english characters eg. æ ø å in the path
  2. Set-PoshPrompt -Theme jandedobbeleer -Verbose

Expected behavior:
Setting the new theme

Actual behavior:

Actual path to binary: C:\Users\nbn\OneDrive - Søren Jensen\Dokumenter\PowerShell\Modules\oh-my-posh\3.140.0\bin\posh-windows-amd64.exe
Error message:

&: The term 'C:\Users\nbn\OneDrive - S├©ren Jensen\Dokumenter\PowerShell\Modules\oh-my-posh\3.140.0\bin\posh-windows-amd64.exe' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Invoke-Expression: Cannot bind argument to parameter 'Command' because it is an empty string.

notice the characters after OneDrive -... they don't match the actual path.

it works fine if i move the binary to another folder (without the special characters) and modify the oh-my-posh.psm1

@JanDeDobbeleer
Copy link
Owner

@fuglphoenix my bad, I removed a line from the module which is in our init script but forgot we load that path before init. You should be able to resolve this by setting the console to UTF8 before importing oh-my-posh and I'll fix that in the meantime: [console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding

@JanDeDobbeleer JanDeDobbeleer added 🐛 bug Something isn't working powershell labels Apr 20, 2021
JanDeDobbeleer added a commit that referenced this issue Apr 20, 2021
@fuglphoenix
Copy link
Author

@JanDeDobbeleer thanks :-)

@JanDeDobbeleer
Copy link
Owner

Let me know if the latest release fixes the issue. In theory it should.

@HughGrant
Copy link

NO, the issue still somehow remains, my username has Chinese character, I have to set the encoding in order for it to work.
But still, I'm glad that I found this

@JanDeDobbeleer
Copy link
Owner

@HughGrant yes, one day Powershell will fix this 😅

Copy link

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues.
If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working powershell
Projects
None yet
Development

No branches or pull requests

3 participants