I don't seem to be able to persuade recode to do this, even with -f:
$ echo 'Frédéric' | recode UTF-8..ASCII Frrecode: Invalid input in step `UTF-8..ANSI_X3.4-1968' $ echo 'Frédéric' | recode -f UTF-8..ASCII Fric
The best that's available when base-config is invoked is probably iconv. That performs slightly less badly, but still not well enough:
$ echo 'Frédéric' | iconv -f UTF-8 -t ASCII Friconv: illegal input sequence at position 2 $ echo 'Frédéric' | iconv -c -f UTF-8 -t ASCII Frdric
The Perl Text::Iconv module's convert() method just returns undef.
If you know how to persuade any of these tools to do the right thing, I'd be interested to hear it.
I don't seem to be able to persuade recode to do this, even with -f:
$ echo 'Frédéric' | recode UTF-8..ASCII .ANSI_X3. 4-1968'
Frrecode: Invalid input in step `UTF-8.
$ echo 'Frédéric' | recode -f UTF-8..ASCII
Fric
The best that's available when base-config is invoked is probably iconv. That
performs slightly less badly, but still not well enough:
$ echo 'Frédéric' | iconv -f UTF-8 -t ASCII
Friconv: illegal input sequence at position 2
$ echo 'Frédéric' | iconv -c -f UTF-8 -t ASCII
Frdric
The Perl Text::Iconv module's convert() method just returns undef.
If you know how to persuade any of these tools to do the right thing, I'd be
interested to hear it.