digitalmars.D.bugs - [Issue 21064] New: setCookieJar/caInfo in std.net.curl cannot handle
- d-bugmail puremagic.com (43/43) Jul 21 2020 https://issues.dlang.org/show_bug.cgi?id=21064
https://issues.dlang.org/show_bug.cgi?id=21064 Issue ID: 21064 Summary: setCookieJar/caInfo in std.net.curl cannot handle the non-ASCII paths Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: enhancement Priority: P1 Component: phobos Assignee: nobody puremagic.com Reporter: zan77137 nifty.com 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 --
Jul 21 2020