title: Convert Chinese docx files to markdown with Pandoc
body: <p>I am batch converting documents that are primarily written in Chinese from docx to markdown using Pandoc within a Powershell script. However, all Chinese characters are being converted to question marks - &quot;?&quot;</p>
  <p>The command I am using is</p>
  <pre><code>pandoc.exe -f  docx -t $converter-simple_tables-multiline_tables-grid_tables+pipe_tables -i $fullexportpath -o &quot;$($fullfilepathwithoutextension).md&quot; --wrap=none --atx-headers --extract-media=&quot;$($mediaPath)&quot;
  </code></pre>
  <p>It works perfectly for English documents, so I presume I just need to add some sort of modifier to handle Chinese characters.</p>
  <p>I have seen various posts about needing to use --latex-engine=xelatex and/or -V CJKmainfont=&quot;Font Name&quot; (I've been using it with &quot;Microsoft YaHei&quot;, the font in Word), but no combinations of these seems to matter (in fact, using --latex-engine at all breaks the conversion). It seems that they are for converting to PDF.</p>
  <p>Any suggestions?</p>
  <p>Edit: the issue was not with Pandoc but with the script I was using that did some find and replace conversion. Works fine with English but not Chinese characters.</p>