Url encoding

Current implementation of `types.url` chokes on unicode characters. This returns a unicode error message to avoid ascii decoding errors