Windows scripting iconv parameter

I am running Gnu iconv from a .bat file in Windows Vista (Sorry about that!)

"C:\Program Files\GnuWin32\bin\iconv.exe" -f ISO-8859-1 -t UTF-8 "%1" > "%1"

If I call

> batch.bat "S:\gutschein_info.php"

It executes as

> "C:\Program Files\GnuWin32\bin\iconv.exe" -f ISO-8859-1 -t UTF-8 
  "S:\gutschein_info.php"  1> "S:\gutschein_info.php"

Then gutschein_info.php is empty. Where does the " 1>" come from? Why is it not working?

Btw: Finally I would like to convert a whole folder:

FOR %%i IN (%1*) DO "C:\Program Files\GnuWin32\bin\iconv.exe" -f ISO-8859-1 -t UTF-8 %%i > %%i

Answers


iconv does not work if input file is the same as the output file. So iconv ... %1 > %1 ist empty but iconv ... %1 > utf8/%1 works. My script:

cd "S:\gutscheine"
S:
mkdir utf8
FOR %%i IN (*) DO "C:\Program Files\GnuWin32\bin\iconv.exe" -f ISO-8859-1 -t UTF-8 %%i > utf8/%%i
C:

Need Your Help

Incrementing undefined object properties without performance penalty

javascript

Is there a way to increment both defined and undefined properties of an plain JS object without performance "penalty"?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.