skywind3000 / z.lua

:zap: A new cd command that helps you navigate faster by learning your habits.
MIT License
2.94k stars 137 forks source link

Zlua unable to deal with chinese char correctly after setting utf8 encoding in powershell. #203

Open owenstake opened 3 months ago

owenstake commented 3 months ago

After set the following in powershell, zlua unable to deal with chinese char correctly.

[Console]::OutputEncoding = [Console]::InputEncoding = [System.Text.Encoding]::utf8

The Error messeage:

PS D:\你好> z 你好
Push-Location : 找不到路径“D:\��”,因为该路径不存在。
所在位置 行:57 字符: 11
+             else { & "Push-Location" "$dest" }
+                    ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (D:\��:String) [Push-Location], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.PushLocationCommand
owenstake commented 3 months ago

~/.zlua is encoded as cp936[dos]