Mixed String type: normal string and unicode : Unicode « Language Basics « Python






Mixed String type: normal string and unicode

Mixed String type: normal string and unicode

print 'ni' + u'spam'        # mixed string types


           
       








Related examples in the same category

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