-
Notifications
You must be signed in to change notification settings - Fork 71
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
Problem with UTF-8 file paths on windows #182
Comments
I suppose it could be related to the same problem we grappled with in readxl and readr where Lines 74 to 75 in 5be4dcc
|
libcurl (on which r curl depends) can write to a FILE. On Windows there's no UTF-8 locale in the CRT UTF-8 has to be converted to UTF-16 and then _wfopen used to open a FILE. |
Fix in curl 4.0 on CRAN now. |
I'm stopping by here again to note that I've re-encountered this problem and, possibly, a version of it that my previous fix does not solve: what if the incoming UTF-8 file path doesn't survive This is not a full reprex, because I'm not really re-opening this issue. I'm just going to say this is currently unsupported. But I want to capture a glimpse of the problem. Here's a local file path I'm trying to upload in googledrive: > filename_2
[1] "C:\\Users\\jenny\\AppData\\Local\\Temp\\RtmpiMUoMa/multibyte-chars-2-マルチ-TEST-drive-upload-jenny" and here's how that path looks in my assembled request (this is via googledrive --> gargle --> Browse[2]> request$body$media$path
[1] "C:\\Users\\jenny\\AppData\\Local\\Temp\\RtmpiMUoMa\\multibyte-chars-2-<U+30DE><U+30EB><U+30C1>-TEST-drive-upload-jenny" which leads to upload failure with Error in curl::curl_fetch_memory(url, handle = handle) :
Failed to open/read local data from file/application This feels like a case where the "proper" solution suggested by @jay is the only thing that will actually work, in general. For googledrive, this would be a "nice to have" vs. "must have". So I just want to record that there has been some real world need, in case anyone is ever motivated to revisit this. |
More notes on what it might look like to do this here in curl: https://github.com/gaborcsardi/rencfaq#how-to-use-utf-8-file-names-on-windows
|
One more thing to add: you need |
Somebody wants to open an issue or pr? |
This presented as tidyverse/googledrive#229 but I'm not sure there's anything I can do about it. I think the problem may ultimately lie in
curl::curl_fetch_disk()
.Created on 2019-04-26 by the reprex package (v0.2.1)
I had to hand-edit the output of
Encoding("äggplanta")
to reflect what I see in the Console. There's some knitr issue that causes it to show as "unknown" in a reprex.The text was updated successfully, but these errors were encountered: