OpenWrt下如何转换成ASCII格式?

OpenWrt下如何转换成ASCII格式?

https://pastebin.com/raw.php?i=eNk7b4fj
亲爱的社区!

在 Fedora 14 下 - Bash:
$ cat asdf | iconv -c -t ASCII
<a href="http://www.net-security.org/secworld.php?id=10607">biometric cabinet lock detects life in the finger</a>
ASDF
$

在 OpenWrt 10.03 下 - Ash:
root@router01:~# cat asdf
<a href="http://www.net-security.org/secworld.php?id=10607">biometric cabinet lock detects �life in the finger�</a>
ASDF
root@router01:~# cat asdf | iconv -c -t ASCII
-ash: iconv: not found
root@router01:~#

但是在 OpenWrt 下没有 iconv。

还有其他可行的方法可以将管道(“|”)文本转换为仅限 ASCII格式(OpenWrt 10.03 下)?

谢谢!

答案1

嗯。您可以使用 cat -v 将其输出为转义字符。如果您只需要转换其中的几个字符,您可以使用sed来替换它

http://linux.byexamples.com/archives/108/beware-of-non-ascii-characters/

或者,使用tr

http://www.devdaily.com/blog/post/linux-unix/how-remove-non-printable-ascii-characters-file-unix

相关内容