I have received some files from Japanese clients and have trouble with reading it through Vim, it looks like a mess: The Shift-JIS encoded file looks like a mess in my Vim

Check the file by $ file -bi command, and it returns: file -bi command and return result

text/plain; charset=unknown-8bit

Fortunately, I’ve been informed that the file is encoded by Shift JIS, saved a hell lot of my time to figure out the encoding.

Shift JIS (Shift Japanese Industrial Standards, also SJIS, Shift_JIS) is a character encoding for the Japanese language, it has been replaced by CP932 for better compatibility in certain cases.

According to Vim Tips Wiki, one can reload a file using a different encoding if Vim was not able to detect the correct encoding.

So, here is the simple solution in Vim, just use :e ++enc=sjis or :e ++enc=cp932:

After reload the file by this command, it become readable

References

⤧  Previous post Fuzzy text searching and case insensitive matching in Oracle database ⤧  Next post [SQL] 字串連接的妙用