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