title: Weird character in windows powershell output file
body: <p>My OS is win10, and powershell version is 7.10.pre6.</p>
  <p>I used <code>ls &gt; D:\test.txt</code> to list the files and wrote to a file. But I found the &quot;Name&quot; column had some weird characters surrounding it, as picture shows:</p>
  <p><a href="https://i.stack.imgur.com/2o6RD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2o6RD.png" alt="snapshot of the output file" /></a></p>
  <p>I don't know why. And when I used command like grep, awk...it turned the chinese character into messy code. For example, <code>ls | grep -i system</code> would result in:</p>
  <pre><code>la---       2020/5/20   涓婂崍11:20        1386296 AppVEntSubsystemController.dll
  la---       2020/6/10   涓嬪崍10:29        2190648 AppVEntSubsystems64.dll
  la---       2020/8/25    涓嬪崍2:07         463168 microsoft-windows-system-events.dll
  la---       2019/3/19   涓嬪崍12:44          95744 systemcpl.dll
  la---       2019/3/19   涓嬪崍12:45         102912 systeminfo.exe
  la---       2020/3/12    涓嬪崍1:46         510768 systemreset.exe
  </code></pre>
  <p>Is that a BUG of powershell? Or is there any way to set the charset? By the way, I tried <code>chcp 65001</code>, and that didn't work.<br />
  Any help would be appreciated.<br />
  Thanks.</p>