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

Keep knowledge of encoding for text properties around #20

Open
mvz opened this issue Aug 30, 2020 · 0 comments
Open

Keep knowledge of encoding for text properties around #20

mvz opened this issue Aug 30, 2020 · 0 comments

Comments

@mvz
Copy link
Owner

mvz commented Aug 30, 2020

Working on #14 brought to light that reading text properties results in a different type of result depending on whether the property type is PT_STRING8 or PT_UNICODE. In the latter case, the result is a Perl string (a sequence of Unicode code points), while in the former case, it is a sequence of bytes.

After reading the property, the knowledge of how it was encoded is discarded, so subsequent code needs to either guess at the data type of the property value, or just ignore it.

It would be better to keep the full knowledge of underlying data and type until the property is used. How it is to be decoded in the case of PT_STRING8 depends both on which property it is, and on the value of the PidTagInternetCodepage and PidTagMessageCodepage properties.

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

1 participant