[postgis-users] Determining file's bit encoding

Stephen Woodbridge woodbri at swoodbridge.com
Mon Sep 29 09:17:05 PDT 2008


You might want to also try LATIN6 and WINDOWS-1256 and see if that works 
with your data. There is not fingerprint that say it is one or another 
encoding.

-Steve W

Nick Paul wrote:
> Hi Paul,
> 
> Thanks for answering my question.  Do you know of anyway to tell which 
> bit encoding is used on a file.  My data is coming from the middle east 
> and I don't know if the data is bad, or if I'm specifying the wrong 
> encoding.  For example, using either LATIN1 and Cp1256 will execute 
> without error, but the data isn't responding the way I expected so I'm 
> unsure if there is a problem with the encoding or just the data.
> 
> Thank you for your help,
> 
> Nick
> 
> On Fri, Sep 26, 2008 at 3:18 PM, Paul Ramsey <pramsey at cleverelephant.ca 
> <mailto:pramsey at cleverelephant.ca>> wrote:
> 
>     You don't need iconv, you can use the -W flag in shp2pgsql:
> 
>     shp2pgsql -W LATIN1 -s 4366 -D foo.shp foo
> 
>     If you're in a western country, your encoding is likely either LATIN1
>     or WIN1252 (they are almost identical, the WIN one has some Windows
>     special characters in it).
> 
>     Here's the list of possibilities:
> 
>     http://www.postgresql.org/docs/8.1/static/multibyte.html
> 
>     P.
> 
>     On Fri, Sep 26, 2008 at 12:05 PM, paul919 <nrpaul at gmail.com
>     <mailto:nrpaul at gmail.com>> wrote:
>      >
>      > Hello,
>      >
>      > I am trying to import data into a PostGIS database that is using
>     the UTF8
>      > bit encoding.  However several of the .shp files that i am
>     importing have a
>      > different bit encoding and it will not let me import the data
>     into PostGIS
>      > unless the bit encodings are the same.  First question, is there
>     anyway
>      > around this?
>      >
>      > If not, I can use the linux iconv utility to convert the files to the
>      > correct UTF8 bit encoding, however i need to know what the
>     current encoding
>      > is on the files.  Second question, how do i determine the bit
>     encoding on a
>      > file?
>      >
>      > Thank you in advance for you help.
>      > --
>      > View this message in context:
>     http://www.nabble.com/Determining-file%27s-bit-encoding-tp19694595p19694595.html
>      > Sent from the PostGIS - User mailing list archive at Nabble.com.
>      >
>      > _______________________________________________
>      > postgis-users mailing list
>      > postgis-users at postgis.refractions.net
>     <mailto:postgis-users at postgis.refractions.net>
>      > http://postgis.refractions.net/mailman/listinfo/postgis-users
>      >
>     _______________________________________________
>     postgis-users mailing list
>     postgis-users at postgis.refractions.net
>     <mailto:postgis-users at postgis.refractions.net>
>     http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list