title: Powershell Chinese characters encoding error
body: <p>I have a file called <code>test.txt</code> which contains a single Chinese character, <code>中</code>, in it.</p>
  
  <p>This character looks like this </p>
  
  <p><a href="https://i.stack.imgur.com/Ukfpu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ukfpu.png" alt="enter image description here"></a></p>
  
  <p>under hex-editor's view.</p>
  
  <p>If I do <code>get-content test.txt | Out-File test_output.txt</code>, the content of <code>test_output.txt</code> is different from <code>test.txt</code>. Why is this hapenning?</p>
  
  <p>I've tried all the encoding parameters listed <a href="https://msdn.microsoft.com/en-us/powershell/reference/4.0/microsoft.powershell.utility/out-file#-encoding" rel="nofollow noreferrer">here</a> ("Unicode", "UTF7", "UTF8", "UTF32", "ASCII", "BigEndianUnicode", "Default", and "OEM"), but none of them correctly converts the Chinese character.</p>
  
  <p>How can I correctly convert Chinese characters using <code>Get-Content</code> and <code>Out-File</code>?</p>
  
  <p>The encoding, <code>e4 b8 ad</code>, looks like <a href="http://www.url-encode-decode.com/" rel="nofollow noreferrer">URLencode</a> of <code>中</code>, is this why all the encoding parameters are not compatible with this Chinese character?</p>
  
  <p>I use <a href="https://notepad-plus-plus.org/" rel="nofollow noreferrer">Notepad++</a> and Notepad++'s <a href="https://sourceforge.net/projects/npp-plugins/files/Hex%20Editor/" rel="nofollow noreferrer">hex-editor plugin</a> as my text-editor and hex-editor, respectively.</p>