Bug 21064 – setCookieJar/caInfo in std.net.curl cannot handle the non-ASCII paths

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2020-07-21T14:15:56Z
Last change time
2024-12-01T16:37:18Z
Assigned to
No Owner
Creator
SHOO
Moved to GitHub: phobos#10430 →

Comments

Comment #0 by zan77137 — 2020-07-21T14:15:56Z
Some of the functions provided by std.net.curl handle paths, such as setCookieJar and caInfo. But they cannot handle the non-ASCII paths. ----------------- import std; void makeCookieFile(string dir) { if (!dir.exists) mkdirRecurse(dir); auto client = HTTP(); client.setCookieJar(dir.buildPath("cookie.txt")); get("https://dlang.org", client); } void main() { auto asciiPath = "abcde"; auto nonAsciiPath = "あいうえお"; makeCookieFile(asciiPath); makeCookieFile(nonAsciiPath); // Assertion failure, the nonAsciiPath is not including anything assert(dirEntries(asciiPath, SpanMode.shallow).map!"a.name".equal( dirEntries(nonAsciiPath, SpanMode.shallow).map!"a.name")); } ----------------- core.exception.AssertError@src\main.d(19): Assertion failure ----------------- I did a little research, but I couldn't figure out what character code should be passed to Curl... Probably that is the system-dependent MBCS(NOT UTF-8). https://curl.haxx.se/libcurl/c/CURLOPT_COOKIEJAR.html
Comment #1 by robert.schadek — 2024-12-01T16:37:18Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10430 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB