data types print( "tage \xc \xe ndecode("latin ")tage asen the differences between the -bit latin- cp (an ibm pc encoding)and utf- encodings make it clear that guessing encodings is not likely to be successful strategy fortunatelyutf- is becoming the de facto standard for plain text filesso later generations may not even know that other encodings ever existed python py files use utf- so python always knows the encoding to use with string literals this means that we can type any unicode characters into our strings--providing our editor supports this when python reads data from external sources such as socketsit cannot know what encoding is usedso it returns bytes which we can then decode accordingly for text files python takes softer approachusing the local encoding unless we specify an encoding explicitly fortunatelysome file formats specify their encoding for examplewe can assume that an xml file uses utf- unless the directive explicitly specifies different encoding so when reading xml we might extractsaythe first byteslook for an encoding specificationand if founddecode the file using the specified encodingotherwise falling back to decoding using utf- this approach should work for any xml or plain text file that uses any of the single byte encodings supported by pythonexcept for ebcdic-based encodings (cp cp and few others (cp cp cp cp cp hzshift-jis- shift-jisx unfortunatelythis approach won' work for multibyte encodings (such as utf- and utf- at least two python packages for automatically detecting file' encoding are available from the python package indexpypi python org/pypi examples ||in this section we will draw on what we have covered in this and the one beforeto present two small but complete programs to help consolidate what we have learned so far the first program is bit mathematicalbut it is quite short at around lines the second is concerned with text processing and is more substantialwith seven functions in around lines of code quadratic py |quadratic equations are equations of the form ax bx where describe parabolas the roots of such equations are derived from the formula it is possible to use other encodings see the python tutorial' "source code encodingtopic