Search code examples
windowsmsys2

MSYS2 ls in cmd output Mojibake


  1. open cmd or powershell in Windows

  2. run 'c:\tools\msys2\usr\bin\ls.exe'

  3. output: ''$'\343\200\214\345\274\200\345\247\213\343\200\215\350\217\234\345\215\225'

MinTTY bash is ok. I want to use LS and other tools in CMD/PowerShell.


MSYS_NT-10.0-25300 version 3.4.5.x86_64 (runneradmin@fv-az411-742) (gcc version 11.3.0 (GCC) ) 2023-01-20 09:17 UTC

Solution

  • Add LANG='C.UTF-8' to Windows system env. it works now.