检查文件是否包含多字节字符 [英] Check if file contains multibyte character

查看:104
本文介绍了检查文件是否包含多字节字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在UTF-8中有一些字幕文件.有时,这些文件中有一些零星的多字节字符,这会在某些应用程序中引起问题.

I have some subtitle files in UTF-8. Sometimes there are some sporadic multibyte characters in these files which cause problem in some applications.

如果某个文件包含任何多字节字符,我如何在linux中检入(并可能找到这些文件).

How do I check in linux (and possibility locate these) if a certain file contains any multibyte character.

推荐答案

您可以使用文件命令

chalet16$ echo test > a.txt
chalet16$ echo testก >  b.txt #One of Thai characters
chalet16$ file *.txt
a.txt: ASCII text
b.txt: UTF-8 Unicode text

这篇关于检查文件是否包含多字节字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆