Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch file to covert unicode text to Ansi text

Tags:

batch-file

How can I convert a directory of pre-existing text from Unicode to ANSI with a batch file? Is there some tool that I can use to loop through the files and perform the conversion?

like image 288
Matilda Ajiri Avatar asked Dec 27 '22 08:12

Matilda Ajiri


1 Answers

See https://superuser.com/questions/27060/batch-convert-files-for-encoding-or-line-ending. Specifically, iconv looks exactly like what you're looking for.

You're looking for the reverse of the example posted there, so you'd want something like this:

$ iconv -f utf-8 -t windows-1252 infile > outfile
like image 143
ziesemer Avatar answered Jan 10 '23 22:01

ziesemer