tools(common/uri): fixed encoding in buildXMPPUri
This commit is contained in:
parent
c05a0028b6
commit
d5908b6ee6
1 changed files with 2 additions and 2 deletions
|
|
@ -75,13 +75,13 @@ def parseXMPPUri(uri):
|
|||
|
||||
def addPairs(uri, pairs):
|
||||
for k,v in pairs.iteritems():
|
||||
uri.append(u';' + urllib.quote_plus(k) + u'=' + urllib.quote_plus(v))
|
||||
uri.append(u';' + urllib.quote_plus(k.encode('utf-8')) + u'=' + urllib.quote_plus(v.encode('utf-8')))
|
||||
|
||||
def buildXMPPUri(type_, **kwargs):
|
||||
uri = [u'xmpp:']
|
||||
subtype = kwargs.pop('subtype', None)
|
||||
path = kwargs.pop('path')
|
||||
uri.append(urllib.quote_plus(path).replace(u'%40', '@'))
|
||||
uri.append(urllib.quote_plus(path.encode('utf-8')).replace(u'%40', '@'))
|
||||
|
||||
if type_ == u'pubsub':
|
||||
if subtype == 'microblog' and not kwargs.get('node'):
|
||||
|
|
|
|||
Loading…
Reference in a new issue