I have dictionary with utf8 string values. I need to print it without any \xd1 , \u0441 or u'string' symbols.
# -*- coding: utf-8 -*-
a = u'lang=русский'
# prints: lang=русский
print(a)
mydict = {}
mydict['string'] = a
mydict2 = repr(mydict).decode("unicode-escape")
# prints: {'string': u'lang=русский'}
print mydict2
expected
{'string': 'lang=русский'}
Is it possible without parsing the dictionary? This question is related with Python print unicode strings in arrays as characters, not code points , but I need to get rid from that annoying u