regrettablygoing into further xml parsing details is beyond this book' scope if you are interested in text or xml parsingit is covered in more detail in the applicationsfocused follow-up book programming python for more details on restructpickleand xmlas well as the additional impacts of unicode on other library tools such as filename expansion and directory walkersconsult the webthe aforementioned book and othersand python' standard library manual for related topicsee also the json example in -- language-neutral data exchange formatwhose structure is very similar to python dictionaries and listsand whose strings are all unicode that differs in type between pythons and much the same as shown for xml here why you will careinspecting filesand much more as was updating this stumbled onto use case for some of its tools after saving formerly ascii html file in notepad as "utf , found that it had grown mystery non-ascii character along the way due to an apparent keyboard operator errorand would no longer work as ascii in text tools to find the bad characteri simply started pythondecoded the file' content from its utf- format via text mode fileand scanned character by character looking for the first byte that was not valid ascii character toof open('py -windows-launcher html'encoding='utf ' read(for (icin enumerate( )tryx encode(encoding='ascii'exceptprint(isys exc_info()[ ] with the bad character' index in handit' easy to slice the unicode string for more detailslen( [ : 'ugh \ cthit[ : 'trace through \ cthiafter fixingi could also open in binary mode to verify and explore actual undecoded file content furtherf open('py -windows-launcher html''rb' read( [ [: '\ \ < unicode and byte strings