(self, value, pfx="")
return u.encode('utf8')
validate string
validate string
validate string
def validate_string(self, value, pfx=""):
        """validate string"""
        ok, u = skytools.safe_utf8_decode(value)
        if ok:
            return value
        _pfx = pfx and (pfx+': ') or ""
        self.log.info('%sFixed invalid UTF8 in string <%s>', _pfx, value)
        return u.encode('utf8')
def validate_string ( self , value , pfx = "" ) : ok , u = skytools . safe_utf8_decode ( value ) if ok : return value _pfx = pfx and ( pfx + ': ' ) or "" self . log . info ( '%sFixed invalid UTF8 in string <%s>' , _pfx , value ) return u . encode ( 'utf8' )