A few lines below, there is the comment:
        # yes. it should be ascii, but we don't want to reject too many
        # characters in the debugger if something breaks

UTF-8 is backwards compatible with ascii, so a pure ascii (0x00-0x7f) file is also a valid UTF-8 file.