Вопрос

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

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

Это было полезно?

Решение

You can use file command

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

Другие советы

You can use file or chardet command.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top