Echo UTF-8 characters in windows batch

后端 未结 5 1876
暖寄归人
暖寄归人 2021-02-03 22:41

Can I use echo to generate an UTF-8 text file? For example if I want to generate a file that contains the character \"ę\"

echo \"abcd ę\" > out.txt

5条回答
  •  甜味超标
    2021-02-03 23:04

    Appears as well as changing the code page you need to write at least one unicode character in your first echo out to the file for the file to be saved as unicode. So your batch file itself needs to be stored in a unicode format like UTF-8.

提交回复
热议问题