Ticket #203 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

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

shp2pgsql.c.patch Download (0.9 KB) - added by dfuhriman 4 years ago.

Change History

Changed 4 years ago by dfuhriman

Changed 4 years ago by pramsey

  • status changed from new to assigned
  • version set to trunk
  • milestone set to postgis 1.4.0

Changed 4 years ago by pramsey

  • version changed from trunk to 1.3.X
  • milestone changed from postgis 1.4.0 to postgis 1.3.6

Changed 4 years ago by pramsey

  • milestone changed from postgis 1.3.6 to postgis 1.3.7

Changed 4 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.

Changed 4 years ago by dfuhriman

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

thanks!

Changed 4 years ago by pramsey

  • status changed from assigned to closed
  • resolution set to fixed

Applied to 1.3 branch at r4678.

Note: See TracTickets for help on using tickets.