(self, data, columns, pfx="")
return _unicode.encode('utf8')
Validate tab-separated fields
Validate tab-separated fields
Validate tab - separated fields
def validate_copy(self, data, columns, pfx=""):
        """Validate tab-separated fields"""

        ok, _unicode = skytools.safe_utf8_decode(data)
        if ok:
            return data

        # log error
        vals = data.split('\t')
        for i, v in enumerate(vals):
            ok, tmp = skytools.safe_utf8_decode(v)
            if not ok:
                self.show_error(columns[i], v, pfx, tmp)

        # return safe data
        return _unicode.encode('utf8')
def validate_copy ( self , data , columns , pfx = "" ) : ok , _unicode = skytools . safe_utf8_decode ( data ) if ok : return data # log error vals = data . split ( '\t' ) for i , v in enumerate ( vals ) : ok , tmp = skytools . safe_utf8_decode ( v ) if not ok : self . show_error ( columns [ i ] , v , pfx , tmp ) # return safe data return _unicode . encode ( 'utf8' )