Tk Library Source Code

View Ticket
Login
Ticket UUID: 2861189
Title: decode and encode: inconsistent handling of line breaks
Type: Bug Version: None
Submitter: thomasmaeder Created on: 2009-09-18 06:13:43
Subsystem: ncgi Assigned To: welch
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2013-07-04 17:25:33
Resolution: Not Applicable Here Closed By:
    Closed on:
Description:
ncgi::encode (and http::formatQuery, for that matter) encodes "\n" as "%0d%0a". ncgi::decode decodes this sequence into "\r\n".

The result is that if a multi-line string is passed from a program to a CGI script that uses ncgi for dealing with the parameters, the CGI script doesn't see the same string the program intended to send it.

If implemented correctly, ncgi::encode and ncgi::decode should therefore be inverse operations, and the one to be adapted seems to be ncgi::decode.