data types ingso unlike other encodingsunicode can handle characters from mixture of languagesrather than just one but how is unicode storedcurrentlyslightly more than unicode characters are definedso even using signed numbersa -bit integer is more than adequate to store any unicode code point so the simplest way to store unicode characters is as sequence of -bit integersone integer per character this sounds very convenient since it should produce one to one mapping of characters to -bit integerswhich would make indexing to particular character very fast howeverin practice things aren' so simplesince some unicode characters can be represented by one or by two code points--for examplee can be represented by the single code point xe or by two code points and ( and combining acute accentnowadaysunicode is usually stored both on disk and in memory using utf utf- or utf- the first of theseutf- is backward compatible with -bit ascii since its first code points are represented by single-byte values that are the same as the -bit ascii character values to represent all the other unicode charactersutf- uses twothreeor more bytes per character this makes utf- very compact for representing text that is all or mostly english the gtk library (used by the gnome windowing systemamong othersuses utf- and it seems that utf- is becoming the de facto standard format for storing unicode text in files--for exampleutf- is the default format for xmland many web pages these days use utf- lot of other softwaresuch as javauses ucs- (which in modern form is the same as utf- this representation uses two or four bytes per characterwith the most common characters represented by two bytes the utf- representation (also called ucs- uses four bytes per character using utf- or utf- for storing unicode in files or for sending over network connection has potential pitfallif the data is sent as integers then the endianness matters one solution to this is to precede the data with byte order mark so that readers can adapt accordingly this problem doesn' arise with utf- which is another reason why it is so popular python represents unicode using either ucs- (utf- formator ucs- (utf- format in factwhen using ucs- python uses slightly simplified version that always uses two bytes per character and so can only represent code points up to xffff when using ucs- python can represent all the unicode code points the maximum code point is stored in the read-only sys maxunicode attribute--if its value is then python was compiled to use ucs- if largerthen python is using ucs- the str encode(method returns sequence of bytes--actually bytes objectcovered in --encoded according to the encoding argument we supply using this method we can get some insight into the difference between encodingsand why making incorrect encoding assumptions can lead to errors