Skip to content

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

Closed
jay wants to merge 1 commit into
curl:masterfrom
jay:windows_stat_access_fallback
Closed

curl_multibyte: fall back to local code page stat/access on Windows#6514
jay wants to merge 1 commit into
curl:masterfrom
jay:windows_stat_access_fallback

Conversation

@jay

@jay jay commented Jan 24, 2021

Copy link
Copy Markdown
Member

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

@MarcelRaad MarcelRaad left a comment

Copy link
Copy Markdown
Member

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.

2 participants