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

Fixed loading profile with non-ASCII path on Windows #4914

Merged
merged 1 commit into from Sep 13, 2020

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Sep 10, 2020

Resolves #4897 - in the same way that #3785 resolved #3145, by loading data from a non-Unicode path on Windows into memory.

Also corrects a message in the test suite from that PR.

@hugovk
Copy link
Member

hugovk commented Sep 12, 2020

What does "non-Unicode" mean here? ASCII?

@fireattack
Copy link

Yeah, was about to comment the title before :p I think he meant non-ASCII.

@nulano
Copy link
Contributor

nulano commented Sep 13, 2020

LCMS2 calls fopen internally, same as FreeType, which on Windows expects a string encoded with the current ANSI codepage: https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/fopen-wfopen?view=vs-2019#remarks

Python returns strings in the utf-8 encoding for the s parameter in PyArg_ParseTuple. These two encodings are only compatible in the ASCII range unless the current codepage is UTF-8, but that is not yet widely supported.

So it seems non-ASCII is the intended message.

@radarhere radarhere changed the title Fixed loading profile with non-Unicode path on Windows Fixed loading profile with non-ASCII path on Windows Sep 13, 2020
@hugovk hugovk merged commit 0ff4cfe into python-pillow:master Sep 13, 2020
@hugovk
Copy link
Member

hugovk commented Sep 13, 2020

Thanks!

@radarhere radarhere deleted the profile_path branch September 13, 2020 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ImageCms.getOpenProfile does not support Unicode path ImageFont and non latin characters in a path to font
4 participants