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

EN Dash (U+2013) character causing failure in non English system #7

Open
whereisjim opened this issue May 2, 2018 · 4 comments
Open

Comments

@whereisjim
Copy link

PSLogging.psm1
line#91
Before:
New-Item -Path $sFullPath ItemType File
After:
New-Item -Path $sFullPath **
-
**ItemType File

I happen to run this function under Korean Windows 10 and it failed to create a new-item.

@9to5IT
Copy link
Owner

9to5IT commented May 6, 2018

This is because the - character most likely gets converted into some different character.

Just trying manually typing -ItemType instead of copy/paste.

davidthemaster30 added a commit to davidthemaster30/PSLogging that referenced this issue Dec 11, 2018
@davidthemaster30
Copy link
Contributor

I've been having this issue since switching to Powershell Core 6.1. It works fine with normal Powershell 5. I have a french Windows OS (fr-ca). I put in a pull request to fix it.

@fourthborngoose
Copy link

I am having an issue with character translation when I output to the screen. It seems that if there was a way to allow for character translation to enable utf8nobom it would solve the fr-ca issue. I just haven't figured out how to do it.
I just think it might be the answer we are looking for when it comes to non-english log outputs and such.

@EReis0
Copy link

EReis0 commented Feb 15, 2024

The op is correct, I noticed the being used instead of a -

If you use (en dash) instead of - (hyphen), PowerShell will not recognize it as a parameter prefix and will throw an error. This is because PowerShell, like most programming languages, expects ASCII characters for its syntax.

When I viewed line #91 in vscode I was able to spot it.
91 New-Item -Path $sFullPath –ItemType File

vscode
New-Item -Path $sFullPath �ItemType File

github
You can notice all of the - are in a different color than the is used in line #91

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