Text of github.com › curl › curl › issues › 14942 as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

curl_url_get for CURLUPART_HOST returns percent decoded string · Issue #14942 · curl/curl · GitHub

Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert curl_url_get for CURLUPART_HOST returns percent decoded string #14942 New issue Copy link New issue Copy link Closed Closed curl_url_get for CURLUPART_HOST returns percent decoded string #14942 Copy link Assignees Labels URL libcurl API Description muttalkadavul opened on Sep 17, 2024 Issue body actions I did this #include <string> #include <regex> #include <tuple> #include <iostream> #include <curl/curl.h> int main() { std::string input = "http://resum%c3%a9.com"; CURLUcode rc = CURLUE_BAD_HANDLE; CURLU *urlh = curl_url(); std::cout << "libcurl version" << curl_version() << std::endl; rc = curl_url_set(urlh, CURLUPART_URL, input.c_str(), 0); if(rc != CURLUE_OK) { std::cout << "curlucode = " << rc << std::endl; curl_url_cleanup(urlh); } char *host; rc = curl_url_get(urlh, CURLUPART_HOST, &host, 0); if (rc != CURLUE_OK) { std::cout << "curlucode = " << rc << std::endl; curl_url_cleanup(urlh); } std::cout << host << std::endl; free(host); curl_url_cleanup(urlh); return 0; } I expected the following libcurl versionlibcurl/8.10.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libpsl/0.21.0 resum%c3%a9.com but the actual output was libcurl versionlibcurl/8.10.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libpsl/0.21.0 resumé.com curl/libcurl version libcurl/8.10.0 operating system Ubuntu 20.04 Activity muttalkadavul commented on Sep 17, 2024 muttalkadavul on Sep 17, 2024 Author More actions Also, if I set the host directly using curl_url_set(urlh, CURLUPART_HOST, hostname.c_str(), 0); and then call get, the hostname is not percent decoded.

I get the expected result. bagder added URL libcurl API on Sep 17, 2024 bagder self-assigned this on Sep 17, 2024 Jayanta0123 commented on Sep 17, 2024 Jayanta0123 on Sep 17, 2024 via email More actions Pls check for a way to set the encoding in standards, UTF-8 or something equivalent. Then the character should be printed properly. … On Tue, 17 Sept 2024 at 17:34, Venkat Krishna R ***@***.***> wrote: Also, if I set the host directly using curl_url_set(urlh, CURLUPART_HOST, hostname.c_str(), 0); and then call get, the hostname is not percent decoded.

I get the expected result. — Reply to this email directly, view it on GitHub < #14942 (comment) >, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ADHD2DTVGAHAVPSJZITISTTZXALD5AVCNFSM6AAAAABOLJX74CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJVGUZDENJZGQ > . You are receiving this because you are subscribed to this thread.Message ID: ***@***.***> -- ------ With Best Wishes, Jayanta Mandal Hyderabad, India bagder commented on Sep 17, 2024 bagder on Sep 17, 2024 Member More actions The host name is indeed treated inconsistently with other components without it being documented. bagder added 2 commits that reference this issue on Sep 17, 2024 urlapi: getting CURLUPART_HOST should be URL encoded by default This issue will close once commit 983ea28 is merged into the 'master' branch.

983ea28 curl_url_set.md: document HOST handling when URL is parsed This issue will close once commit 421a333 is merged into the 'master' branch. 421a333 bagder closed this as completed in c0a9db8 on Sep 18, 2024 vszakats added a commit that references this issue on Sep 18, 2024 curl_url_set.md: document HOST handling when URL is parsed This issue will close once commit c0a9db8 is merged into the 'master' branch. c0a9db8 pps83 added a commit that references this issue on Apr 26, 2025 curl_url_set.md: document HOST handling when URL is parsed This issue will close once commit 9a73e2c is merged into the 'master-min' branch.

9a73e2c Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Metadata Metadata Assignees bagder Labels URL libcurl API Type No type Projects No projects Milestone No milestone Relationships None yet Development No branches or pull requests Issue actions You can’t perform that action at this time.