import os

if (__name__ == '__main__'):

  angstrom = u'\u212b'
  unicode_path = u'/this/is/' + angstrom + u'/fake/path/'
  str_path = unicode_path.encode('utf8')
  print str_path

  # check if os.path works with unicode path
  try:
    exists = os.path.isdir(unicode_path)
    print 'unicode path works'
  except UnicodeEncodeError:
    print 'unicode path fails'

  # this should always work
  try:
    exists = os.path.isdir(str_path)
    print 'str path works'
  except:
    print 'str path fails'
