simply pass the name of the file' encoding to the open built-in in (codecs open(in )data will be decoded per the specified encoding when it is read from the file you can also read in binary mode and manually decode the bytes to string by giving an encoding namebut this involves extra work and is somewhat error-prone for multibyte characters (you may accidentally read partial character sequence to create unicode text file in specific encoding formatpass the desired encoding name to open in (codecs open(in )strings will be encoded per the desired encoding when they are written to the file you can also manually encode string to bytes and write it in binary modebut this is usually extra work ascii text is considered to be kind of unicode textbecause its -bit range of values is subset of most unicode encodings for examplevalid ascii text is also valid latin- text (latin- simply assigns the remaining possible values in an -bit byte to additional charactersand valid utf- text (utf- defines variable-byte scheme for representing more charactersbut ascii characters are still represented with the same codesin single bytethis makes unicode backward-compatible with the mass of ascii text data in the world (though it also may have limited its options--self-identifying textfor instancemay have been difficult (though boms serve much the same role the impact of python ' string types change depends upon the types of strings you use for scripts that use simple ascii text on platforms with ascii-compatible default encodingsthe impact is probably minorthe str string type works the same in and in this case moreoveralthough string-related tools in the standard library such as restructpickleand xml may technically use different types in than in xthe changes are largely irrelevant to most programs because ' str and bytes and ' str support almost identical interfaces if you process unicode datathe toolset you need has simply moved from ' unicode and codecs open(to ' str and open if you deal with binary data filesyou'll need to deal with content as bytes objectssince they have similar interface to stringsthoughthe impact should again be minimal that saidthe update of the book programming python for ran across numerous cases where unicode' mandatory status in implied changes in standard library apis--from networking and guisto databases and email in generalunicode will probably impact most users eventually test your knowledgeanswers