Possible Duplicate:
How do I convert files between encodings where only some of them are wrong?
I use the following command to convert .srt files from windows-1250 to utf-8 from a folder
for /f "delims=" %%a IN (' dir C:\utf_check\*.srt /b /s ') do %iconv% -s -f windows-1250 -t utf-8 < %%a > %%a.txt
I have a problem with this, if the file is already utf-8, iconv breaks the file inserting strange characters. Is there a way to detect first if is utf-8 or ascii then convert it? I tried with flip, enca, encov, recode with no success.
I use Windows 2003 Server, I installed Cygwin too, maybe that would help.
Example: that is the text found in a utf-8 Aşezaţi-vă. and this is the text after iconv is converting again AĹźezaĹŁi-vÄ.