Show
Ignore:
Timestamp:
01/23/07 21:32:43 (23 months ago)
Author:
asterix
Message:

merge fixes from trunk

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/gajim_0.11/src/common/helpers.py

    r7787 r7888  
    2626import sha 
    2727from encodings.punycode import punycode_encode 
     28from encodings import idna 
    2829 
    2930import gajim 
     
    8586 
    8687        return prep(*decompose_jid(jidstring)) 
     88 
     89def idn_to_ascii(host): 
     90        '''convert IDN (Internationalized Domain Names) to ACE (ASCII-compatible encoding)''' 
     91        labels = idna.dots.split(host) 
     92        converted_labels = [] 
     93        for label in labels: 
     94                converted_labels.append(idna.ToASCII(label)) 
     95        return ".".join(converted_labels) 
    8796 
    8897def parse_resource(resource):