[Rpm-metadata] unicode conversion

seth vidal skvidal at phy.duke.edu
Sat Oct 25 06:04:25 UTC 2003

hi all,
  this is what I did, comments?

def utf8String(string):
    """hands back a unicoded string"""
        string = unicode(string)
    except UnicodeError, e:
        newstring = ''
        for char in string:
            if ord(char) > 127:
                newstring = newstring + '#'
                newstring = newstring + char
        newstring = newstring + 'NOTE: Characters replaced outside of UTF8 Range'
        return unicode(newstring)
        return string


More information about the Rpm-metadata mailing list