Example #1
0
 def unicode(str, encoding):
     return wstring.decode(encoding, str).utf8()
Example #2
0
 def unicode(str, encoding='US-ASCII'):
     """Create a UTF-8 string"""
     try:
         return wstring.decode(string.upper(encoding), str).utf8()
     except:
         return str
Example #3
0
 def to_xml_string(str,encoding):
     if string.lower(self._encoding) == 'utf-8':
         return str
     else:
         return wstring.decode(encoding,str).utf8()