input and output known as surrogate pair both characters have values in the range [ + +dfffand are combined to encode -bit character value the surrogate encoding is as follows:the -byte sequence nnn nnnnnn nmmmm mmmmm is encoded as the pair + nu+dc mwhere is the upper bits and is the lower bits of the -bit character encoded in the -byte utf- sequence fiveand -byte utf- sequences (denoted by starting bit sequences of and respectivelyare used to encode character values up to bits in length these values are not supported by python and currently result in unicodeerror exception if they appear in an encoded data stream utf- encoding has number of useful properties that allow it to be used by older software firstthe standard ascii characters are represented in their standard encoding this means that utf- -encoded ascii string is indistinguishable from traditional ascii string secondutf- doesn' introduce embedded null bytes for multibyte character sequences thereforeexisting software based on the library and programs that expect null-terminated -bit strings will work with utf- strings finallyutf- encoding preserves the lexicographic ordering of strings that isif and are unicode strings and bthen also holds when and are converted to utf- thereforesorting algorithms and other ordering algorithms written for -bit strings will also work for utf- 'utf- ''utf- -be'and 'utf- -leencoding utf- is variable-length -bit encoding in which unicode characters are written as -bit values unless byte ordering is specifiedbig endian encoding is assumed in additiona byte-order marker of +feff can be used to explicitly specify the byte ordering in utf- data stream in big endian encodingu+feff is the unicode character for zero-width nonbreaking spacewhereas the reversed value +fffe is an illegal unicode character thusthe encoder can use the byte sequence fe ff or ff fe to determine the byte ordering of data stream when reading unicode datapython removes the byte-order markers from the final unicode string 'utf- -beencoding explicitly selects utf- big endian encoding 'utf- -leencoding explicitly selects utf- little ending encoding although there are extensions to utf- to support character values greater than bitsnone of these extensions are currently supported 'unicode-escapeand 'raw-unicode-escapeencoding these encoding methods are used to convert unicode strings to the same format as used in python unicode string literals and unicode raw string literals here' an examples '\ \ \ encode('unicode-escape'# '\ \ \ unicode character properties in addition to performing /oprograms that use unicode may need to test unicode characters for various properties such as capitalizationnumbersand whitespace the unicodedata module provides access to database of character properties general character properties can be obtained with the unicodedata category(cfunction for exampleunicodedata category( " "returns 'lu'signifying that the character is an uppercase letter lib fl ff