Does that last query (invoking the upper() function) actually run well when executed in pgsql console?<div><br></div><div><br></div><div>Rob<br><br><div class="gmail_quote">2009/10/16 Arnaud Lesauvage <span dir="ltr"><arnaud.listes@codata.eu></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi all!<br>
<br>
I have an UTF8 encoded shapefile, and an UTF8 encoded postgis-enabled database. I want my shapefile to be encoded in WIN1252, and a particular field to be in uppercase.<br>
<br>
Since I am on windows, I don't have an iconv executable. Therefore, I am trying to :<br>
- dump the shapefile with shp2pgsql to an sql text file<br>
- load the resulting sql file into a postgresql table<br>
- dump this table into a shapefile with pgsql2shp (in WIN1252)<br>
<br>
To load the shapefile into postgresql, I had to dump it without specifying a '-W' argument, set my client_encoding to UTF8, then load the sql file into postgresql.<br>
<br>
If I look at the data with pgAdmin (with client_encoding set to UTF8), it looks good : accentuation is fine, special characters are fine.<br>
<br>
To dump the data in a WIN1252-encoded shapefile, pgsql2shp has no encoding argument, so I set my client encoding to WIN1252 thtough the environment variable PGCLIENTENCODING.<br>
<br>
If I just dump the file this way, it seems to be fine. So this command works fine :<br>
pgsql2shp -f myouput.shp -u postgres -g mygeom mydatabase "SELECT mytext, mygeom FROM mytemptable"<br>
-> [621679 rows]<br>
<br>
But then, if I dump it through a query to have my field in uppercase, I get an error 'character 0xc29f of encoding UTF8 has no equivalent in WIN1252' (translated by myself, the message is in French)<br>
The command is simply :<br>
pgsql2shp -f myouput.shp -u postgres -g mygeom mydatabase "SELECT upper(mytext) as mytext, mygeom FROM mytemptable"<br>
<br>
So I guess there is a problem with my 'upper' conversion, but I have no idea what this 0xc29f character could be.<br>
<br>
Any help would be greatly appreciated.<br>
Thanks a lot !<br><font color="#888888">
<br>
--<br>
Arnaud Lesauvage<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</font></blockquote></div><br></div>