ascii-only: safely handle non-unicode characters
This commit is contained in:
parent
3d715ef18e
commit
64906e2ffb
@ -4,11 +4,12 @@ ascii() {
|
|||||||
coproc toascii {
|
coproc toascii {
|
||||||
perl -e '
|
perl -e '
|
||||||
use utf8;
|
use utf8;
|
||||||
|
use Encode;
|
||||||
use Text::Unidecode;
|
use Text::Unidecode;
|
||||||
use open qw(:std :utf8);
|
use open qw(:std :utf8);
|
||||||
$| = 1;
|
$| = 1;
|
||||||
while (<>) {
|
while (<>) {
|
||||||
print(unidecode($_));
|
print(unidecode(encode("utf-8", $_)));
|
||||||
}'
|
}'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user