title: UTF-8 Filenames return Not Found in linux terminal
body: <p>I have a problem with some files in linux (Ubuntu) terminal, with accents in the names. For example:</p>
  
  <pre><code>$ ls dir/
  criação.png 
  </code></pre>
  
  <p>So, the terminal returns that file, so it exists. Now lets look if the file exists, with this simple command:</p>
  
  <pre><code>$ [ -f criação.png ] &amp;&amp;  echo "File Exist" || echo "Not Exist"
  Not Exist
  </code></pre>
  
  <p>As you can see, "Not Exist". Now, i have the same folder and file on OSX, then I run the same command and it returns this:</p>
  
  <pre><code>$ [ -f criação.png ] &amp;&amp;  echo "File Exist" || echo "Not Exist"
  File Exist
  </code></pre>
  
  <p>I know a little about <em>locale</em>:</p>
  
  <pre><code>$ locale
  LANG=en_US.UTF-8
  LANGUAGE=
  LC_CTYPE=en_US.UTF-8
  LC_NUMERIC="en_US.UTF-8"
  LC_TIME="en_US.UTF-8"
  LC_COLLATE="en_US.UTF-8"
  LC_MONETARY="en_US.UTF-8"
  LC_MESSAGES="en_US.UTF-8"
  LC_PAPER="en_US.UTF-8"
  LC_NAME="en_US.UTF-8"
  LC_ADDRESS="en_US.UTF-8"
  LC_TELEPHONE="en_US.UTF-8" 
  LC_MEASUREMENT="en_US.UTF-8"
  LC_IDENTIFICATION="en_US.UTF-8"
  LC_ALL=
  </code></pre>
  
  <p>On linux, "Not Exist", on OSX, "File Exist"... Someone, know how to fix that?</p>
  
  <p>Maybe these can help:<br>
  <a href="http://nedbatchelder.com/blog/201106/filenames_with_accents.html">http://nedbatchelder.com/blog/201106/filenames_with_accents.html</a><br>
  <a href="http://www.ruby-forum.com/topic/279105">http://www.ruby-forum.com/topic/279105</a></p>
  
  <p><strong>UPDATE - Solution</strong></p>
  
  <p>I finally found a solution to that problem. You need to rename your files from NFD to NFC, here is the command to fix all files:</p>
  
  <pre><code>cd dir/
  convmv -r -i -f utf8 -t utf8 --nfc --notest .
  </code></pre>
  
  <p>Source: <a href="http://blog.hbis.fr/2010/08/30/macox-utf8_filenames_normalization/">http://blog.hbis.fr/2010/08/30/macox-utf8_filenames_normalization/</a></p>