How to replace Unicode characters with ASCII

前端 未结 4 771
被撕碎了的回忆
被撕碎了的回忆 2021-02-15 18:35

I have the following command to replace Unicode characters with ASCII ones.

sed -i \'s/Ã/A/g\'

The problem is à isn\'t recognized

4条回答
  •  太阳男子
    2021-02-15 19:03

    Try setting LANG=C and then run it over the Unicode range:
    echo "hi ☠ there ☠" | LANG=C sed "s/[\x80-\xFF]//g"

提交回复
热议问题