title: Powershell: echo "" > file.txt VS clear-content file.txt
body: <p>depending on how i clear a file in powershell, i get garbage.</p>
  
  <pre><code>echo "" &gt; ".\file.txt"
  OR
  clear-content ".\file.txt"
  THEN
  [io.file]::AppendAllText("file.txt", "teststring")
  </code></pre>
  
  <p>Using clear-content, I will get "teststring" in my "file.txt".</p>
  
  <p>Using echo "" > ".\file.txt", I get garbage chinese characters.</p>
  
  <p>WHY? does echo "" > file mess with encoding?</p>