Opened 11 years ago

Closed 11 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 11 years ago.

Download all attachments as: .zip

Change History (7)

Changed 11 years ago by dfuhriman

Attachment: shp2pgsql.c.patch added

comment:1 Changed 11 years ago by pramsey

Milestone: postgis 1.4.0
Status: newassigned
Version: trunk

comment:2 Changed 11 years ago by pramsey

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

comment:3 Changed 11 years ago by pramsey

Milestone: postgis 1.3.6postgis 1.3.7

comment:4 Changed 11 years ago by mcayland

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 Changed 11 years ago by dfuhriman

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

thanks!

comment:6 Changed 11 years ago by pramsey

Resolution: fixed
Status: assignedclosed

Applied to 1.3 branch at r4678.

Note: See TracTickets for help on using tickets.