cURL / Mailing Lists / curl-library / Single Mail

curl-library

Issue with the line feed character

From: Tiago Cerqueira (1090678) <1090678_at_isep.ipp.pt>
Date: Mon, 13 Jul 2015 18:03:56 +0000

Hi everyone,

I'm currently using curlpp to perform an HTTP query, but curlpp is reporting that there are illegal characters in the URL. I've narrowed down the URL problem to a variable that is being read from a config file (one line, it just contains the information needed). Another weird thing is that this only happens on a Fedora x64bits installation (I haven't tried other x64bits distros). On my two development machines it runs perfectly fine (Ubuntu and OpenSuse, 32bits). I've tried printing the ASCII code of the characters read from the file and everything looks perfectly normal, however, there is a line feed character at the end of the string. Now, this character occurs in all systems, but on the Fedora system it is reported as an illegal character. Replacing this character by the null termination character makes the program work perfectly again.

I was wondering if there is an option to force curlpp to ignore the line feed character. I’ve also tried escaping the string with the curl_easy_escape function, but it converts the line feed character to the percent encoding %0A. This, in turn, is not recognized by the HTTP server as an existing URL (it outputs a 404 error).

Has anyone encountered this issue before? Is it possible to ignore this character, or is the best approach just to replace it?

Thanks in advance for your help!

Best regards,
Tiago Cerqueira
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-07-13