Hak*_*kim 76 linux bash text utf-8 character-encoding
我有一堆阿拉伯语,英语,俄语文件,用utf-8编码.尝试使用Perl脚本处理这些文件,我收到此错误:
Malformed UTF-8 character (fatal)
Run Code Online (Sandbox Code Playgroud)
手动检查这些文件的内容,我发现其中有一些奇怪的字符.现在我正在寻找一种从文件中自动删除这些字符的方法.
无论如何要做到这一点?
Pal*_*tir 142
这个命令:
iconv -f utf-8 -t utf-8 -c file.txt
Run Code Online (Sandbox Code Playgroud)
将清除您的UTF-8文件,跳过所有无效字符.
-f is the source format
-t the target format
-c skips any invalid sequence
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
90946 次 |
| 最近记录: |