Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Specific Built-in Types > Unicode Strings

Unicode Strings

Technically, all text is Unicode text, including the simple 8-bit ASCII encoding scheme. Python supports Unicode (wide) character strings, which represent each character with 16 or more bits, not 8. This support differs in Python lines. Python 3.0 treats all text as Unicode and represents binary data separately, while Python 2.X distinguishes 8-bit text (and data) from wider Unicode text. Specifically:

  • In Python 2.6, the str type represents both 8-bit text and binary data, and a separate unicode type handles wide-character Unicode text. A u'ccc' literal form supports coding binary data, and a codecs module supports reading and writing files containing Unicode text.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial