On Sun, Aug 11, 2024 at 04:39:52AM +0300, Samuel Henrique via curl-library wrote: > This feature request comes from a discussion we've had in wcurl: > https://salsa.debian.org/debian/wcurl/-/merge_requests/4 > > It's about performing the decoding of the output filename when -O is used, so > for example, if I call: > $ curl -O example.com/filename%20with%20spaces.txt > I would like to be able to get as the output file: > "filename with spaces.txt" instead of "filename%20with%20spaces.txt".
The big problem with this is character set conversion. If the URL is in UTF-8 and the user's filesystem is in CP1252, this will produce a garbage file name. Or even worse, the other way around which could result in a file that's not even accessible by some software. Since there's no way to tell what character set the URL is in, this seems impossible to do correctly. Unless you're suggesting just handling characters in the range 0x20-0x7e or something along those lines, but that could result in confused users when some files are converted and some are not. Dan -- Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library Etiquette: https://curl.se/mail/etiquette.html
