开发者

convert the encoding of many files?

I have 2000 files encoded in windows-1256. i want to convert their encoding to UTF-8 (all in once)

can notep开发者_运维问答ad++ do something like this?


I just encountered the same problem. In case of someone needs it:

#!/bin/bash
mkdir ../converted
for x in `ls *`
   do iconv -f Windows-1256 -t UTF-8 $x > ../converted/$x
done

Note: this is for UNIX systems, in case of Windows you can use Cygwin.


I have worked at a place where some files where incorrectly downloaded in UTF-8 instead of Windows-1252.
I have created a batch file that contains the command to iconv and got it scheduled to every 30 seconds. Unfortunately I can not show you the details since I no longer have access to it.

http://gnuwin32.sourceforge.net/packages/libiconv.htm

Hope this will help you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜