Caffeine, silicon and nimesulide

{ 'fullname' : "Michele Zonca", 'tags' : ['developer', 'mashaper', 'caffeinated', 'nerd']}

forcing text files to UTF-8 charset

first of all I use file utility to get the file charset, with -b and -i parameters to have a brief report, in mime type style:

michele@erakis:~$ file -bi file.txt
text/html; charset=unknown-8bit
michele@erakis:~$ vi file.txt

then in vi

:set encoding=utf-8
:set fileencoding=utf-8
:wq

let’s check

michele@erakis:~$ file -bi file.txt
text/html; charset=utf-8

  1. shatsar posted this