title: Javascript - strip out occurrences of u' in JSON string, parse is returning unexpected token
body: <p>I have a textfield in a database that contains the results of a python <code>json.dumps(list_instance)</code> operation.  As such, the internal fields have a <code>u'</code> prefix, and break the browser's <code>JSON.parse()</code> function.</p>
  
  <p>An example of the JSON string is</p>
  
  <pre><code>"density": "{u'Penobscot': 40.75222856500098, u'Sagadahoc': 
    122.27083333333333, u'Lincoln': 67.97977755308392, u'Kennebec': 
    123.12237174095878, u'Waldo': 48.02117802779616, u'Cumberland':  
    288.9285325791363, u'Piscataquis': 3.9373586457405247, u'Hancock': 
    30.698239582715903, u'Washington': 12.368718341168325, u'Aroostook': 
    10.827378163074039, u'York': 183.47612497543722, u'Franklin':  
    16.89330963710371, u'Oxford': 25.171240748402518, u'Somerset': 
    12.425648288323485, u'Knox': 108.48302300109529, u'Androscoggin': 
    208.75502815768303}"
  </code></pre>
  
  <p>What I'd like to do is replace those occurrences of <code>u'</code> with a <code>'</code>(single-quote).  I've tried</p>
  
  <pre><code>function renderValues(data){
     var pop = JSON.parse(data.density.replace(/u'/g, "'"));
  }
  </code></pre>
  
  <p>but I'm always getting a <code>unexpected token '</code> exception.  Since many of the possible key fields may contain a <code>u</code>, it is not feasable to just delete that character.  How can I find all instances of <code>u'</code> and replace with <code>'</code> without getting the exception?</p>