Show characters with accents in redirect file (>output.txt)

老子叫甜甜 提交于 2019-12-04 12:51:55

You may use the /U switch of cmd.exe in order to output Unicode characters. For example:

cmd /U /C dir > dirInUnicode.txt

However, this switch works on internal commands only, so you must use an auxiliary file in order to convert the output of mode command:

mode con: cp>%tmp%\output1.tmp
cmd /U /C type %tmp%\output1.tmp > %tmp%\output2.tmp

Use PowerShell instead of DOS as a command line prompt. Its works flawlessly with special characters.

C:> powershell
PS C:> mode con: cp > temp.txt
PS C:> notepad temp.txt
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!