fix encoding functions return values

This should fix the problem of adding URLs into the add application form.

To test, create a gateway node and add applications with the following URLs (all should be accepted):
* 127.0.0.1
* http://commotionwireless.net/test
* https://127.0.0.1/testing
* https://127.0.0.1:22/testing/123.html?foo=bar&baz=