Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrectly encoded string property raises exception #9

Open
srepmub opened this issue Feb 6, 2017 · 1 comment
Open

incorrectly encoded string property raises exception #9

srepmub opened this issue Feb 6, 2017 · 1 comment

Comments

@srepmub
Copy link
Contributor

srepmub commented Feb 6, 2017

one of our customers provided a PST file which contains an incorrectly encoded PR_BODY property somewhere. looking at it, it contains the following byte sequence:

0x3d 0xd8 0xd 0x0

so a surrogate pair is started, but the next 2 bytes to complete it aren't there.. or something. it seems useful for your version to at least add errors='ignore' to the decode call, so the whole process will just go on.

elif self.ptype == PTypeEnum.PtypString:

  •        return bytes.decode('utf-16-le') # unicode
    
  •       return bytes.decode('utf-16-le', errors='ignore') # unicode
    
@bli-dn
Copy link
Contributor

bli-dn commented Nov 8, 2018

Long time to respond, sorry :) if you do a PR I will merge for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants