-2

I have a text file with UTF-8 encodding and now i want to convert that file to ANSI encodding.

I tried opening a text file in notepad with ANSI encodding and tried copied to another file so that the another file will be having the same contents with ANSI encodding.

%SystemRoot%\notepad.exe /a "output1.txt" >> output2.txt
exit
Brian
  • 117
  • 4

1 Answers1

0

You don't need notepad for this. In fact, notepad is a really poor choice for encoding conversion. The widely used tool for encoding conversion is iconv. You can get ready to use binaries by installing MSys2.

Another option is to use – say – Python3 for conversion

open(out_file_name, 'w', encoding=out_encoding).write(open(in_file_name, 'r', encoding=in_encoding).read())
datenwolf
  • 159,371
  • 13
  • 185
  • 298