Iconv is converting to UTF-16 instead of UTF-8 when invoked from powershell
问题 I have a problem while trying to batch convert the encoding of some files from ISO-8859-1 to UTF-8 using iconv in a powershell script. I have this bat file, that works ok: for %%f in (*.txt) do ( echo %%f C:\"Program Files"\GnuWin32\bin\iconv.exe -f iso-8859-1 -t utf-8 %%f > %%f.UTF_8_MSDOS ) I need to convert all files on the directories structure, so I programmed this other script, this time using powershell: Get-ChildItem -Recurse -Include *.java | ForEach-Object { $inFileName = $_