Convert all files in current folder from UTF8 to ANSI, name unchanged.

Asking for a Linux command line to
convert all files in current folder from UTF8 to ANSI, name unchanged.

Best Regards
Pei

Technically, any ASCII characters are represented in UTF-8 as pure ASCII, 8-bits per byte, no funny encoding. If your files are pure ASCII anyway, no conversion's needed. And any characters which aren't, already have no ASCII equivalent -- they'd just be stripped out.

In other words, content -- or at least punctuation -- could be lost. Are you positive you want the originals overwritten?

for FILE in *.txt
do
        [ -f "$FILE" ] || continue

        iconv -c -f UTF8 -t ASCII "$FILE" > /tmp/$$ && cat /tmp/$$ > "$FILE"
done

rm -f /tmp/$$

iconv seems not able to convert the file itself, which seems to tell, to keep the file name while converting is impossible....

What difference does it make? You wanted it converted and ending up in the same file, this does that. (Against my better judgement, I might add.)