title: Czech unicode issue in Python Django
body: <p>I have this URL <a href="https://%C4%8Desk%C3%A9bud%C4%9Bjovice.mysite.com/" rel="nofollow noreferrer">https://českébudějovice.mysite.com/</a> and it's a Czech city name. When someone accesses that url, I extract the subdomain and query for City model object. So I have City model in Django and can successfully query that city thru shell:</p>
  
  <pre><code>&gt;&gt; City.objects.get(name='českébudějovice')
  &gt;&gt; &lt;City: České Budějovice, Czech Republic&gt;
  </code></pre>
  
  <p>However today I received an exception on Sentry on production saying that 'City matching query does not exist' and the URL is shown like this:</p>
  
  <pre><code>xn--eskbudjovice-deb41c5g.mysite.com
  </code></pre>
  
  <p>Obviously, I don't have a City with the name 'xn--eskbudjovice-deb41c5g' hence I'm getting 'City matching query does not exist' error. </p>
  
  <p>I've been trying to convert that weird subdomain to the actual name but no luck. I've tried below:</p>
  
  <pre><code>&gt;&gt; s='xn--eskbudjovice-deb41c5g'
  &gt;&gt; print s.encode('utf8')
  &gt;&gt; xn--eskbudjovice-deb41c5g
  </code></pre>
  
  <p>I'm using Cloudflare and I wonder if it's somehow converting url to that form instead of serving it as unicode to my server. </p>