title: Convert every dictionary value to utf-8 (dictionary comprehension?)
body: <p>I have a dictionary and I want to convert every value to utf-8.  This works, but is there a "more pythonic" way?</p>
  
  <pre><code>            for key in row.keys():
                  row[key] = unicode(row[key]).encode("utf-8")
  </code></pre>
  
  <p>For a list I could do</p>
  
  <pre><code>[unicode(s).encode("utf-8") for s in row]
  </code></pre>
  
  <p>but I'm not sure how to do the equivalent thing for dictionaries.</p>
  
  <p>This is different from <a href="https://stackoverflow.com/questions/14507591/python-dictionary-comprehension">Python Dictionary Comprehension</a> because I'm not trying to create a dictionary from scratch, but from an existing dictionary.  The solutions to the linked question do not show me how to loop through the key/value pairs in the existing dictionary in order to modify them into new k/v pairs for the new dictionary.  The answer (already accepted) below shows how to do that and  is much clearer to read/understand for someone who has a task similar to mine than the answers to the linked related question, which is more complex.</p>