Dictionary with keys in unicode

Viewed 16366

Is it possible in Python to use Unicode characters as keys for a dictionary? I have Cyrillic words in Unicode that I used as keys. When trying to get a value by a key, I get the following traceback:

 Traceback (most recent call last):
 File "baseCreator.py", line 66, in <module>
    createStoresTable()
 File "baseCreator.py", line 54, in createStoresTable
    region_id = regions[region]
 KeyError: u'\u041c\u0438\u043d\u0441\u043a/\u041c\u043e\u0441\u043a\u043e\u0432\u0441\u043a\u0438\u0439\xa0'
2 Answers
Related