title: How to handle python unicode string in javascript?
body: <p>A dict in which the string values are unicode string like <code>{'name': u'nav', 'school': u'mps'}</code></p>
  
  <p>In <strong>javascript</strong>, i'm trying access that dict like</p>
  
  <pre><code>&lt;script&gt;
  var poi = {{ dict }}  ........... //Line #1
  alert( poi.name )
  &lt;/script&gt;
  </code></pre>
  
  <p>while rending the html page line #1 is rendered as (error):</p>
  
  <pre><code>{'lastname': u'yadav', 'age': 23, 'id': 2, 'firstname': u'sahenky'}
  </code></pre>
  
  <p>One python solution is to encode the unicode string into some other format like ascii or utf-8(preferred)</p>
  
  <pre><code>str = u'nav'
  str.encode('utf-8, 'ignore')
  &gt;&gt;str
  nav
  </code></pre>
  
  <p>Is there any elegant way to encode unicode string in python or javascript?</p>