Open sxyazi opened 5 days ago
Hey, @sxyazi! The -Encoding UTF8
solution works fine for me.
This is the final one I'd use:
function y {
$tmp = [System.IO.Path]::GetTempFileName()
yazi --cwd-file="$tmp"
$cwd = Get-Content -Path $tmp -Encoding UTF8
if (-not [String]::IsNullOrEmpty($cwd) -and $cwd -ne $PWD.Path) {
$cwd = [System.IO.Path]::GetFullPath($cwd)
Set-Location -LiteralPath $cwd
}
Remove-Item -Path $tmp
}
Also added GetFullPath
, to convert possible /
to \
, if it ever comes to that.
Nice! Would you like to raise a PR to get the credit?
What system are you running Yazi on?
Windows
What terminal are you running Yazi in?
wezterm
yazi --debug
outputDescribe the bug
Windows powershell Chinese character decoding error when use "y" command.
Minimal reproducer
start yazi via "y" alias, select a path that contains Chinese characters, then press "q" quit yazi.
Anything else?
Resolved via add
-Encoding UTF8
arg to Powershell wrapper function's line 4.Maybe docs should be modified to add this arg ?
Validations
yazi --debug
) input box to the nightly that I triedmv ~/.config/yazi ~/.config/yazi-backup
)