Save text file in UTF-8 encoding using cmd.exe
As the existing answer says, in a batch file, you can use the chcp
command
chcp 65001 > nulsome_command > file
But if you are using the cmd.exe
from its command line, e.g. to execute a user-defined command, you can use this syntax:
cmd.exe /c chcp 65001 > nul & cmd.exe /c some_command > file