1

I have a folder on Windows that contains files whose name contain unicode extended characters (simplified chinese). I'd like to grab a list of these files. Of course, cmd won't display them correctly, but I was hoping Powershell could.

Unfortunately, the result of the dir command isn't any better. When I search existing questions, everything is about the file encoding, not displaying the file name.

I'm not looking to make any system-wide change like changing the system locale or the default code-page, but I would expect PowerShell to be able to handle unicode output on screen.

Dave M
  • 13,138
  • 25
  • 36
  • 47
mrgou
  • 231
  • 1
  • 4
  • 16
  • I have edited the question to make it distinct from "Change default code page of Windows console to UTF-8". – mrgou Apr 18 '18 at 13:54
  • Have you read this question: https://stackoverflow.com/questions/22789415/read-utf-8-files-correctly-with-powershell – music2myear Apr 18 '18 at 22:12
  • 1
    The issue you're having isn't related to PowerShell but rather the font you got in PowerShell. If you run the following command you will find that the output contains the Unicode characters `Get-ChildItem | Out-File -FilePath output.txt -Encoding utf8`. If you want to see those characters on the console select a font that works/has codepoints for it as an example MS Gothic. – Seth Apr 19 '18 at 13:05
  • Thanks for your comment @Seth, I tried to pipe the output into a text file as you suggested, and it works in PowerShell, but it doesn't work in CMD. – Thariq Nugrohotomo Mar 14 '21 at 01:37
  • `I'm not looking to make any system-wide change` yet this question is closed "because it already has answers on another thread which makes system-wide change". I'm seeing a lot of valid question gets closed while I think it shouldn't. – Thariq Nugrohotomo Mar 14 '21 at 01:42

0 Answers0