Opened 15 years ago

Closed 14 years ago

#203 closed defect (fixed)

shp2pgsql does not correctly encode control characters

Reported by: dfuhriman Owned by: pramsey
Priority: medium Milestone: PostGIS 1.3.7
Component: postgis Version: 1.3.X
Keywords: Cc:

Description

When using the -D option to shp2pgsql, any dbf fields that contain embedded newlines or carriage returns are not handled correctly. These fields need to be converted to \r and \n, respectively, or postgres will not accept them.

The attached patch fixes this.

Attachments (1)

shp2pgsql.c.patch (884 bytes ) - added by dfuhriman 15 years ago.

Download all attachments as: .zip

Change History (7)

by dfuhriman, 15 years ago

Attachment: shp2pgsql.c.patch added

comment:1 by pramsey, 15 years ago

Milestone: postgis 1.4.0
Status: newassigned
Version: trunk

comment:2 by pramsey, 15 years ago

Milestone: postgis 1.4.0postgis 1.3.6
Version: trunk1.3.X

comment:3 by pramsey, 15 years ago

Milestone: postgis 1.3.6postgis 1.3.7

comment:4 by mcayland, 15 years ago

Thanks for the patch.

I think this may already be fixed in trunk/1.4 - any chance you could build and test the 1.4 beta release? If it's still broken, please attach a small shapefile example and I'll review it later. I'm not sure there will be a 1.3.7 release…

Many thanks,

Mark.

comment:5 by dfuhriman, 15 years ago

Yes, the code in the current trunk seems to work just fine (at least on my problem shapefiles).

thanks!

comment:6 by pramsey, 14 years ago

Resolution: fixed
Status: assignedclosed

Applied to 1.3 branch at r4678.

Note: See TracTickets for help on using tickets.