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

curl_multibyte: fall back to local code page stat/access on Windows #6514

Closed
wants to merge 1 commit into from

Conversation

@jay
Copy link
Member

@jay jay commented Jan 24, 2021

If libcurl is built with Unicode support for Windows then it is assumed
the filename string is Unicode in UTF-8 encoding and it is converted to
UTF-16 to be passed to the wide character version of the respective
function (eg wstat). However the filename string may actually be in the
local encoding so, even if it successfully converted to UTF-16, if it
could not be stat/accessed then try again using the local code page
version of the function (eg wstat fails try stat).

We already do this with fopen (ie wfopen fails try fopen), so I think it
makes sense to extend it to stat and access functions.

Closes #xxxx

@jay jay added the Windows label Jan 24, 2021
@jay jay requested a review from MarcelRaad Jan 24, 2021
@jay jay force-pushed the jay:windows_stat_access_fallback branch from 7ec58ec to 1472522 Jan 24, 2021
Copy link
Member

@MarcelRaad MarcelRaad left a comment

👍

If libcurl is built with Unicode support for Windows then it is assumed
the filename string is Unicode in UTF-8 encoding and it is converted to
UTF-16 to be passed to the wide character version of the respective
function (eg wstat). However the filename string may actually be in the
local encoding so, even if it successfully converted to UTF-16, if it
could not be stat/accessed then try again using the local code page
version of the function (eg wstat fails try stat).

We already do this with fopen (ie wfopen fails try fopen), so I think it
makes sense to extend it to stat and access functions.

Closes #xxxx
@jay jay force-pushed the jay:windows_stat_access_fallback branch from 1472522 to 18a4976 Feb 3, 2021
@jay jay closed this in b48db90 Feb 9, 2021
@jay jay deleted the jay:windows_stat_access_fallback branch Feb 9, 2021
@jay jay removed the next-feature-window label Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants