Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
hugovk merged 1 commit into
python-pillow:masterfrom
radarhere:profile_path
Sep 13, 2020
Merged

Fixed loading profile with non-ASCII path on Windows#4914
hugovk merged 1 commit into
python-pillow:masterfrom
radarhere:profile_path

Conversation

@radarhere

@radarhere radarhere commented Sep 10, 2020

Copy link
Copy Markdown
Member

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

hugovk commented Sep 12, 2020

Copy link
Copy Markdown
Member

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

@fireattack

Copy link
Copy Markdown

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

@nulano

nulano commented Sep 13, 2020

Copy link
Copy Markdown
Contributor

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

hugovk commented Sep 13, 2020

Copy link
Copy Markdown
Member

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