How to use command line tools for Mac OS X (and UNIX) such as grep with UTF-16 files?

I have a bunch of text files that I want to use with grep. They all belong to an external source and are encoded in UTF-16 encoding and begin with a byte order sign.

Unix tools like grep don't work for them for me. What is the work around this?

+4
source share
1 answer

Just use iconv (1) to change them to utf-8.

+7
source

Source: https://habr.com/ru/post/1337580/


All Articles