Using iconv with //TRANSLIT//IGNORE to convert from utf8 to ascii works fine; it replaces non-convertible characters with the correct transliteration according to the current locale (de_DE in my case):
> echo 'möp' | iconv -f 'UTF8' -t 'ASCII//TRANSLIT//IGNORE' moep
However, when using //IGNORE without //TRANSLIT it throws an error:
> echo 'möp' | iconv -f 'UTF8' -t 'ASCII//IGNORE' mp iconv: illegal input sequence at position 5
I wonder why this is happening. Is the input sequence exactly the same and shouldn't //IGNORE just skip invalid characters? When using iconv C api, I get an EILSEQ error - so basically I don’t know if the input string contained invalid UTF8 or not ...
source share