Encoding of Generated Patches and Pastebin Plugin

David Narvaez david.narvaez at computer.org
Thu Dec 22 05:06:39 UTC 2011

On Wed, Dec 21, 2011 at 10:34 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> Right, see my other mail. I implied that we'd write our own
> percent-encoding (since that is a rather easy thing to do after all,
> very limited set of rules etc.) that operates directly on the data.
> Are you sure about pastebin requiring some specific encoding? Or does it
> simply require a properly setup POST request with a
> content-transfer-encoding setting?

>From http://pastebin.com/api (requires login)

Creating A New Paste
Creating a new paste via our API is very easy. You simply have to send
a valid POST request to the URL shown below. Please make sure you are
sending the data as the UTF-8 charset!

> Also since I've recently stumbled over this myself, I wonder wether
> there's any need for the percent-encoding at all, if its a POST-request
> there shouldn't be any necessity to percent-encode any of the elements
> (unless again this is specific to the pastebin API, but that would be
> strange since a browser also wouldn't percent-encode the data when it
> sends a POST request)...

Good point, I just tried a post without percent encoding and the
behavior is just as bad as before (wrong characters due to encoding),
but since it doesn't break any further, I think we need no percent
encoding there. But that makes me wonder what could have gone wrong:
If I theoretically moved QString out of the equation, where are bytes
interpreted as Latin-1 characters? I'll keep taking a look at this.

David E. Narváez

More information about the KDevelop-devel mailing list