Use the unicode() function produce a corresponding Unicode string from a specific encoding : Unicode « Language Basics « Python






Use the unicode() function produce a corresponding Unicode string from a specific encoding

#If you have data in a specific encoding and want to produce a corresponding 
#Unicode string from it, 
#you can use the unicode() function with the encoding name 
#as the second argument.

print unicode('\xc3\xa4\xc3\xb6\xc3\xbc', 'utf-8')


           
       








Related examples in the same category

1.Mixed String type: normal string and unicodeMixed String type: normal string and unicode
2.Convert string: unicode to normal stringConvert string: unicode to normal string
3.Convert string:normal to unicode Convert string:normal to unicode
4.Creating Unicode strings in PythonCreating Unicode strings in Python
5.Small 'u' in front of the quote indicates that an Unicode stringSmall 'u' in front of the quote indicates that an Unicode string
6.'ur' to have Python use the Raw-Unicode-Escape encoding'ur' to have Python use the Raw-Unicode-Escape encoding
7.Built-in function unicode() provides access to all registered Unicode codecs Built-in function unicode() provides access to all registered Unicode codecs
8.Convert a Unicode string into an 8-bit string