Re: [postgis-users] pgsql2shp dbf file encoding

2010-10-26 Thread Mark Cave-Ayland

Denis Rykov wrote:

After editing dbf file in hex editor and set value at byte 29 to 00h 
shapefile opens in ArcGIS without

encoding troubles (get codepage value from *.cpg file).


That's strange. Does anyone know what the behaviour of the 
psDBF-iLanguageDriver field should be in terms of how it reacts with a 
.cpg file? Frank?



ATB,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] pgsql2shp dbf file encoding

2010-10-25 Thread Mark Cave-Ayland

Denis Rykov wrote:

Try to export postgis data to shapefiles with pgsql2shp 
(pgsql2shp-core.h 5870 2010-08-28 09:16:32Z mcayland)
If open *.dbf file I see the value in my dbf files at byte 29 is 0x57h. 
Is the 0x57h value is default? Why not 0x00h?

With 0x57h encoding my shapefiles looks not correct in any GIS software.


I don't think it's currently set to anything, so I guess this would be 
the default? Perhaps we should provide a mapping from PostgreSQL 
database encoding names to shapefile encoding values in a table somewhere?


Anyone know which encoding 0x57h represents?


ATB,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] pgsql2shp dbf file encoding

2010-10-25 Thread Francis Markham
0x57h is the dreaded Windows-1252 codepage.  I believe new versions of
shapelib allow this to be set when the shapefile is created.

Cheers,

Francis Markham


On 25 October 2010 20:05, Mark Cave-Ayland
mark.cave-ayl...@siriusit.co.uk wrote:

 Denis Rykov wrote:

 Try to export postgis data to shapefiles with pgsql2shp (pgsql2shp-core.h 
 5870 2010-08-28 09:16:32Z mcayland)
 If open *.dbf file I see the value in my dbf files at byte 29 is 0x57h. Is 
 the 0x57h value is default? Why not 0x00h?
 With 0x57h encoding my shapefiles looks not correct in any GIS software.

 I don't think it's currently set to anything, so I guess this would be the 
 default? Perhaps we should provide a mapping from PostgreSQL database 
 encoding names to shapefile encoding values in a table somewhere?

 Anyone know which encoding 0x57h represents?


 ATB,

 Mark.

 --
 Mark Cave-Ayland - Senior Technical Architect
 PostgreSQL - PostGIS
 Sirius Corporation plc - control through freedom
 http://www.siriusit.co.uk
 t: +44 870 608 0063

 Sirius Labs: http://www.siriusit.co.uk/labs
 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] pgsql2shp dbf file encoding

2010-10-25 Thread Denis Rykov
I don't quite understand why pgsql2shp is writing this encoding to our
shapes, our database is in UTF-8 and we never use win1252

On Mon, Oct 25, 2010 at 5:42 PM, Francis Markham fmark...@gmail.com wrote:

 0x57h is the dreaded Windows-1252 codepage.  I believe new versions of
 shapelib allow this to be set when the shapefile is created.

 Cheers,

 Francis Markham


 On 25 October 2010 20:05, Mark Cave-Ayland
 mark.cave-ayl...@siriusit.co.uk wrote:
 
  Denis Rykov wrote:
 
  Try to export postgis data to shapefiles with pgsql2shp
 (pgsql2shp-core.h 5870 2010-08-28 09:16:32Z mcayland)
  If open *.dbf file I see the value in my dbf files at byte 29 is 0x57h.
 Is the 0x57h value is default? Why not 0x00h?
  With 0x57h encoding my shapefiles looks not correct in any GIS software.
 
  I don't think it's currently set to anything, so I guess this would be
 the default? Perhaps we should provide a mapping from PostgreSQL database
 encoding names to shapefile encoding values in a table somewhere?
 
  Anyone know which encoding 0x57h represents?
 
 
  ATB,
 
  Mark.
 
  --
  Mark Cave-Ayland - Senior Technical Architect
  PostgreSQL - PostGIS
  Sirius Corporation plc - control through freedom
  http://www.siriusit.co.uk
  t: +44 870 608 0063
 
  Sirius Labs: http://www.siriusit.co.uk/labs
  ___
  postgis-users mailing list
  postgis-users@postgis.refractions.net
  http://postgis.refractions.net/mailman/listinfo/postgis-users
 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] pgsql2shp dbf file encoding

2010-10-25 Thread Mark Cave-Ayland

Denis Rykov wrote:

I don't quite understand why pgsql2shp is writing this encoding to our 
shapes, our database is in UTF-8 and we never use win1252


Well pgsql2shp has never contained any code to set the encoding field 
(mainly because until recently the version of shapelib included with 
PostGIS didn't support the encoding field), so I guess WIN1252 must be 
the shapelib default.



ATB,

Mark.

--
Mark Cave-Ayland - Senior Technical Architect
PostgreSQL - PostGIS
Sirius Corporation plc - control through freedom
http://www.siriusit.co.uk
t: +44 870 608 0063

Sirius Labs: http://www.siriusit.co.uk/labs
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] pgsql2shp dbf file encoding

2010-10-25 Thread Paul Ramsey
And that DBF field dates from the Time Before UTF-8, so there won't be
a UTF8 number to put in it, in any event.  DBF files with UTF in
them (OSM!) are scary scary scary (for example, should your code for
reading a CHAR(8) field in DBF expect 8 bytes, or 8 characters? yay!)
It would be nice to support transcoding down to the code pages that
*are* supported in that field, I suppose. I wonder how much software
actually supports it.

P.

On Mon, Oct 25, 2010 at 9:57 AM, Mark Cave-Ayland
mark.cave-ayl...@siriusit.co.uk wrote:
 Denis Rykov wrote:

 I don't quite understand why pgsql2shp is writing this encoding to our
 shapes, our database is in UTF-8 and we never use win1252

 Well pgsql2shp has never contained any code to set the encoding field
 (mainly because until recently the version of shapelib included with PostGIS
 didn't support the encoding field), so I guess WIN1252 must be the shapelib
 default.


 ATB,

 Mark.

 --
 Mark Cave-Ayland - Senior Technical Architect
 PostgreSQL - PostGIS
 Sirius Corporation plc - control through freedom
 http://www.siriusit.co.uk
 t: +44 870 608 0063

 Sirius Labs: http://www.siriusit.co.uk/labs
 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] pgsql2shp dbf file encoding

2010-10-25 Thread Denis Rykov
Will it make sense to set 0 as a default? In the current case some software
(ArcGIS) does not override correct CPG setting with obviously incorrect 1252
from the header.

On Tue, Oct 26, 2010 at 12:03 AM, Paul Ramsey pram...@opengeo.org wrote:

 And that DBF field dates from the Time Before UTF-8, so there won't be
 a UTF8 number to put in it, in any event.  DBF files with UTF in
 them (OSM!) are scary scary scary (for example, should your code for
 reading a CHAR(8) field in DBF expect 8 bytes, or 8 characters? yay!)
 It would be nice to support transcoding down to the code pages that
 *are* supported in that field, I suppose. I wonder how much software
 actually supports it.

 P.

 On Mon, Oct 25, 2010 at 9:57 AM, Mark Cave-Ayland
 mark.cave-ayl...@siriusit.co.uk wrote:
  Denis Rykov wrote:
 
  I don't quite understand why pgsql2shp is writing this encoding to our
  shapes, our database is in UTF-8 and we never use win1252
 
  Well pgsql2shp has never contained any code to set the encoding field
  (mainly because until recently the version of shapelib included with
 PostGIS
  didn't support the encoding field), so I guess WIN1252 must be the
 shapelib
  default.
 
 
  ATB,
 
  Mark.
 
  --
  Mark Cave-Ayland - Senior Technical Architect
  PostgreSQL - PostGIS
  Sirius Corporation plc - control through freedom
  http://www.siriusit.co.uk
  t: +44 870 608 0063
 
  Sirius Labs: http://www.siriusit.co.uk/labs
  ___
  postgis-users mailing list
  postgis-users@postgis.refractions.net
  http://postgis.refractions.net/mailman/listinfo/postgis-users
 
 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] pgsql2shp dbf file encoding

2010-10-25 Thread Paul Ramsey
Can you hexedit it and see if it works better?

On Mon, Oct 25, 2010 at 10:25 AM, Denis Rykov ryk...@gmail.com wrote:
 Will it make sense to set 0 as a default? In the current case some software
 (ArcGIS) does not override correct CPG setting with obviously incorrect 1252
 from the header.

 On Tue, Oct 26, 2010 at 12:03 AM, Paul Ramsey pram...@opengeo.org wrote:

 And that DBF field dates from the Time Before UTF-8, so there won't be
 a UTF8 number to put in it, in any event.  DBF files with UTF in
 them (OSM!) are scary scary scary (for example, should your code for
 reading a CHAR(8) field in DBF expect 8 bytes, or 8 characters? yay!)
 It would be nice to support transcoding down to the code pages that
 *are* supported in that field, I suppose. I wonder how much software
 actually supports it.

 P.

 On Mon, Oct 25, 2010 at 9:57 AM, Mark Cave-Ayland
 mark.cave-ayl...@siriusit.co.uk wrote:
  Denis Rykov wrote:
 
  I don't quite understand why pgsql2shp is writing this encoding to our
  shapes, our database is in UTF-8 and we never use win1252
 
  Well pgsql2shp has never contained any code to set the encoding field
  (mainly because until recently the version of shapelib included with
  PostGIS
  didn't support the encoding field), so I guess WIN1252 must be the
  shapelib
  default.
 
 
  ATB,
 
  Mark.
 
  --
  Mark Cave-Ayland - Senior Technical Architect
  PostgreSQL - PostGIS
  Sirius Corporation plc - control through freedom
  http://www.siriusit.co.uk
  t: +44 870 608 0063
 
  Sirius Labs: http://www.siriusit.co.uk/labs
  ___
  postgis-users mailing list
  postgis-users@postgis.refractions.net
  http://postgis.refractions.net/mailman/listinfo/postgis-users
 
 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users


 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users


___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


Re: [postgis-users] pgsql2shp dbf file encoding

2010-10-25 Thread Denis Rykov
After editing dbf file in hex editor and set value at byte 29 to 00h
shapefile opens in ArcGIS without
encoding troubles (get codepage value from *.cpg file).

On Tue, Oct 26, 2010 at 12:30 AM, Paul Ramsey pram...@opengeo.org wrote:

 Can you hexedit it and see if it works better?

 On Mon, Oct 25, 2010 at 10:25 AM, Denis Rykov ryk...@gmail.com wrote:
  Will it make sense to set 0 as a default? In the current case some
 software
  (ArcGIS) does not override correct CPG setting with obviously incorrect
 1252
  from the header.
 
  On Tue, Oct 26, 2010 at 12:03 AM, Paul Ramsey pram...@opengeo.org
 wrote:
 
  And that DBF field dates from the Time Before UTF-8, so there won't be
  a UTF8 number to put in it, in any event.  DBF files with UTF in
  them (OSM!) are scary scary scary (for example, should your code for
  reading a CHAR(8) field in DBF expect 8 bytes, or 8 characters? yay!)
  It would be nice to support transcoding down to the code pages that
  *are* supported in that field, I suppose. I wonder how much software
  actually supports it.
 
  P.
 
  On Mon, Oct 25, 2010 at 9:57 AM, Mark Cave-Ayland
  mark.cave-ayl...@siriusit.co.uk wrote:
   Denis Rykov wrote:
  
   I don't quite understand why pgsql2shp is writing this encoding to
 our
   shapes, our database is in UTF-8 and we never use win1252
  
   Well pgsql2shp has never contained any code to set the encoding field
   (mainly because until recently the version of shapelib included with
   PostGIS
   didn't support the encoding field), so I guess WIN1252 must be the
   shapelib
   default.
  
  
   ATB,
  
   Mark.
  
   --
   Mark Cave-Ayland - Senior Technical Architect
   PostgreSQL - PostGIS
   Sirius Corporation plc - control through freedom
   http://www.siriusit.co.uk
   t: +44 870 608 0063
  
   Sirius Labs: http://www.siriusit.co.uk/labs
   ___
   postgis-users mailing list
   postgis-users@postgis.refractions.net
   http://postgis.refractions.net/mailman/listinfo/postgis-users
  
  ___
  postgis-users mailing list
  postgis-users@postgis.refractions.net
  http://postgis.refractions.net/mailman/listinfo/postgis-users
 
 
  ___
  postgis-users mailing list
  postgis-users@postgis.refractions.net
  http://postgis.refractions.net/mailman/listinfo/postgis-users
 
 
 ___
 postgis-users mailing list
 postgis-users@postgis.refractions.net
 http://postgis.refractions.net/mailman/listinfo/postgis-users

___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[postgis-users] pgsql2shp dbf file encoding

2010-10-24 Thread Denis Rykov
Try to export postgis data to shapefiles with pgsql2shp (pgsql2shp-core.h
5870 2010-08-28 09:16:32Z mcayland)
If open *.dbf file I see the value in my dbf files at byte 29 is 0x57h. Is
the 0x57h value is default? Why not 0x00h?
With 0x57h encoding my shapefiles looks not correct in any GIS software.
___
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users