title: What character set is "é" from? (Python: Filename with "é", how to use os.path.exists , filecmp.cmp, shutil.move?)
body: <p>What Character set is <code>é</code> from? In Windows notepad having this character in an ANSI text file will save fine. Insert something like <code></code> and you'll get an error. <code>é</code> seems to work fine in ASCII terminal in Putty (Are CP437 and IBM437 the same?) where as <code></code> does not.</p>
  
  <p>I can see that <code></code> is Unicode, not ASCII. But what is <code>é</code>? It doesn't give errors I get with Unicode in Notepad, but Python was throwing <code>SyntaxError: Non-ASCII character '\xc3' in file on line , but no encoding declared;</code> before I added a "magic comment" as suggested by <a href="https://stackoverflow.com/questions/26899235/python-nltk-syntaxerror-non-ascii-character-xc3-in-file-sentiment-analysis">Python NLTK: SyntaxError: Non-ASCII character &#39;\xc3&#39; in file (Sentiment Analysis -NLP)</a>.</p>
  
  <p>I added the "magic comment" and don't get that error, but os.path.isfile() is saying a filename with <code>é</code> doesn't exist. Ironic that the character <code>é</code> is in <code>Marc-André Lemburg</code>, the author of the PEP the error links to.</p>
  
  <p>EDIT: If I print the path of the file, the accented e shows up as <code>├⌐</code> but I can copy and paste <code>é</code> into the command prompt.</p>
  
  <p>EDIT2: See below</p>
  
  <pre><code>Private    &gt; cat scratch.py   ### LOL cat scratch :3
  # coding=utf-8
  file_name = r"Filéname"
  file_name = unicode(file_name)
  Private    &gt; python scratch.py
  Traceback (most recent call last):
    File "scratch.py", line 3, in &lt;module&gt;
      file_name = unicode(file_name)
  UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3: ordinal not in range(128)
  Private    &gt;
  </code></pre>
  
  <p>EDIT3:</p>
  
  <pre><code>Private    &gt; PS1="Private    &gt; " ; echo code below ; cat scratch.py ; echo =======  ; echo output below ; python scratch.py
  code below
  # -*- coding: utf-8 -*-
  
  file_name = r"Filéname"
  file_name = unicode(file_name, encoding="utf-8")
  
  # I have code here to determine a path depending on the hostname of the
  # machine, the folder paths contain no Unicode characters, for my debug
  # version of the script, I will hardcode the redacted hostname.
  hostname = "One"
  if hostname == "One":
      folder = "C:/path/folder_one"
  elif hostname == "Two":
      folder = "C:/path/folder_two"
  else:
      folder = "C:/path/folder_three"
  
  path = "%s/%s" % (folder, file_name)
  path = unicode(path, encoding="utf-8")
  
  
  print path
  =======
  output below
  Traceback (most recent call last):
    File "scratch.py", line 18, in &lt;module&gt;
      path = unicode(path, encoding="utf-8")
  TypeError: decoding Unicode is not supported
  Private    &gt;
  </code></pre>