title: Django, nginx, gunicorn,supervisor: UnicodeEncodeError - when uploading non-latin named file
body: <p>When I upload some files with non-latin names I got error:</p>
  
  <pre><code>UnicodeEncodeError at /profiles/
  'ascii' codec can't encode characters in position 39-41: ordinal not in range(128)
  </code></pre>
  
  <p>I've tried change supervisor environment how it's described <a href="https://stackoverflow.com/questions/3715865/unicodeencodeerror-ascii-codec-cant-encode-character/10986010#10986010">here</a>, but it didn't help. I've added this line in /etc/supervisor/supervisord.conf:</p>
  
  <pre><code>[supervisord]
  environment=LANG="ru_RU.utf8", LC_LANG="ru_RU.UTF-8", LC_ALL="ru_RU.UTF-8"
  logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
  pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
  childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)
  </code></pre>
  
  <p>When I put this line in program specific conf file it did not begin working too.</p>
  
  <p>I've tried figure out my encoding, so I've add to template context this variable:</p>
  
  <pre><code>context['locale'] = sys.getfilesystemencoding()
  </code></pre>
  
  <p>and in template it shows "ANSI_X3.4-1968"</p>
  
  <p>Could please someone explain why changing environment did not solve the problem?</p>