title: Using utf8 everywhere in/with perl script
body: <p>I'm running latest perl under german Windows 7 and I want to use utf8 everywhere in my perl programs (for the script, the file contents, file names, mail texts, etc.).</p>
  
  <p>All works fine, but I'm facing problems when trying to process files having special characters in filename. Even <code>system</code> calls do not work well. So (how) can I tell perl to use <code>utf8</code> <strong>everywhere</strong>?</p>
  
  <p>I tried a while with <code>encode</code> and <code>decode</code> but it's very unclear why that works as it works... Also I need to <code>encode('cp850', TEXT)</code> for a correct display in the command prompt window.</p>
  
  <p>Examples:</p>
  
  <p>When I need to copy a file, it only works when I use <code>File::copy(encode("iso-8859-1", $filename), ...)</code> and when I want to work with pdf file contens the successful command is <code>system(encode('cp850', sprintf('pdftk.exe %s...', decode('utf8', $file))));</code></p>
  
  <p>Why is that (especially the decode in the system call) and is there a more easy way? Maybe something with <code>use open ':encoding...'</code>, but I had no luck so far.</p>