Navigation Menu

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 Windows-specific label Jan 24, 2021
@jay jay requested a review from MarcelRaad January 24, 2021 23:23
@jay jay force-pushed the windows_stat_access_fallback branch from 7ec58ec to 1472522 Compare January 24, 2021 23:25
Copy link
Member

@MarcelRaad MarcelRaad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jay jay added the feature-window A merge of this requires an open feature window label Jan 26, 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 force-pushed the windows_stat_access_fallback branch from 1472522 to 18a4976 Compare February 3, 2021 20:16
@jay jay closed this in b48db90 Feb 9, 2021
@jay jay deleted the windows_stat_access_fallback branch February 9, 2021 07:56
@jay jay removed the feature-window A merge of this requires an open feature window label Feb 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Windows Windows-specific
Development

Successfully merging this pull request may close these issues.

None yet

2 participants