Powershell profile Set-Location cannot find Path? But works normally otherwise

Set-location 'C:\Users\me\OneDrive - Freie Universität Berlin'

Including the above in the PowerShell profile leads to "path cannot be found because it doesn't exist" error. It does exist, and a running PowerShell executes the exact same command without issue.

I've tried double quotes, I've tried -LiteralPath. Using Set-location 'C:\Users\me\temp' in the profile works.

Edit: It's the "ä" character. An identical folder name (without "ä") has no problems. Unfortunately OneDrive folders like this one can't be renamed easily. The same command works just fine if copied into PS


Solution 1:

Changed encoding of the profile.ps1 to "UTF-8-BOM" in Notepad++, now PS handles non-ASCII correctly