Tuesday 24 July 2018

windows - Batch change encoding ascii files from utf-8 to iso-8859-1




Possible Duplicate:
Batch-convert files for encoding or line ending under Windows



I need a tool like this
http://www.rotatingscrew.com/utfcast.aspx


But the tool should do the opposite, convert multiple files from utf-8 to iso-8859-1


Is there any tool (php script, batch file, etc.) for Windows that can do this? Thanks



Answer



You can use iconv from GNUWin32, it works the same as the GNU/Linux counterpart:


iconv -f UTF-8 -t ISO-8859-1 filename.txt

you can then use it with batch, provided you've added it to your %PATH%:


for /f %x in ('dir /b *.txt') do iconv -f UTF-8 -t ISO-8859-1 %x

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...