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
But i have a problem with this, if the file is already utf-8 iconv break 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 a windows 2003 server, i installed cygwin too maybe that would help.
Ex: 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Ä.
thanx