zacharyvoase/urlobject — pull request #13 by agriffis (2013-01-14 23:20:20+00:00)
Title: Fixes for querystring encode/decode

This commit brings three fixes to qs_encode and qs_decode:
1. Use quote_plus/unquote_plus rather than quote/unquote so that spaces are encoded as +.
2. Avoid implicit s.decode in qs_encode. This happens if a str is passed to qs_encode, since s.encode in that case needs to decode first.
3. Avoid implicit s.encode in qs_decode. This happens because of calling str(s).

The implicit conversions use the (platform and environment dependant) default encoding, so it's better to avoid them and explicitly handle unicode objects with deliberate encode/decode to utf-8.