我在macosx上使用TextEdit创建了两个文件,相同的内容有不同的编码,然后
grep xxx filename_UTF-16
没有
grep xxx filename_UTF-8
XXXXXXX
xxxxxxyyyyyy
grep did not support UTF-16?
解决方法:
iconv -f UTF-16 -t UTF-8 yourfile | grep xxx
标签:linux,grep,unicode,utf-16,utf-8
来源: https://codeday.me/bug/20190826/1734397.html