title: How can I be sure of the file encoding?
body: <p>I have a PHP file that I created with VIM, but I'm not sure which is its encoding.</p>
  
  <p>When I use the terminal and check the encoding with the command <code>file -bi foo</code> (My operating system is Ubuntu 11.04) it gives me the next result:</p>
  
  <p><code>text/html; charset=us-ascii</code></p>
  
  <p>But, when I open the file with gedit it says its encoding is UTF-8.</p>
  
  <p>Which one is correct? I want the file to be encoded in UTF-8.</p>
  
  <p>My guess is that there's no BOM in the file and that the command <code>file -bi</code> reads the file and doesn't find any UTF-8 characters, so it assumes that it's ascii, but in reality it's encoded in UTF-8.</p>