Skip to main content
10000+ Posts
How to clean strings from false bytes?

Bulk copy failed on table 'tv.vagnat_framtida' using delimiter ':'. Error was 'ERROR:  invalid byte sequence for encoding "UTF8": 0xc3 0x3aCONTEXT:  COPY vagnat_framtida, line 33This error kept me busy for some hours exploring character encoding in shapefiles, FME and PostGIS. Which did not help. Not until I did some data digging and found the error.The data in a shapefile apparently comes from a qualified geodata store, and some long text fields have been truncated in the conversion to shape, leaving what appears to be incomplete character codes. And this causes PostGIS problems. The error message comes from deep within PostGIS. I have tried to cut a few bytes from the string with SubstringExtractor, but then the whole string became HEX. Very strange. Since it is invalid data, there seems to be no way of catching these characters with any of the FME string tools. And the error appears only in the Postgis writer, not before so it can

Badge Winners

Show all badges

Community Stats

32,343
Posts
122,979
Replies
40,417
Members