Ensure pdb header title is encoded correctly.

This commit is contained in:
John Schember 2009-06-12 20:18:51 -04:00
parent 52e9ee0ce3
commit f8dacaa28d

View File

@ -66,7 +66,7 @@ class PdbHeaderBuilder(object):
def __init__(self, identity, title):
self.identity = identity.ljust(3, '\x00')[:8]
self.title = re.sub('[^-A-Za-z0-9]+', '_', title).ljust(32, '\x00')[:32].encode('utf-8')
self.title = re.sub('[^-A-Za-z0-9]+', '_', title).ljust(32, '\x00')[:32].encode('ascii', 'replace')
def build_header(self, section_lengths, out_stream):
'''