Exemple #1
0
 def unicode(self):
     a = self.attributes
     enc = encodings[a['encoding'].strip()]
     if not enc:
         log.warning('Unknown encoding: %s' % a['encoding'])
         raise AttributeError('unicode')
     return unicode(chr(a['char1'])+chr(a['char2']), enc)
Exemple #2
0
 def str(self):
     a = self.attributes
     enc = encodings[a['encoding'].strip()]
     if not enc:
         log.warning('Unknown encoding: %s' % a['encoding'])
         raise AttributeError('str')
     return str(chr(a['char1']) + chr(a['char2'])).encode(enc)