[gdal-dev] Does the OGR PotsGis driver support by default UTF-8 ?

Matthieu Rigal rigal at rapideye.de
Tue May 5 07:07:47 EDT 2009


Hi all,

I have a problem with using the ExecuteSQL command of ogr within Python...
My version of GDAL/OGR is 1.5.1

I first open the connexion normally, without problem, with my UTF-8 Database.
I sent some insert commands with ascii values without problem, there are added 
and taken into account.

BUT when I send the query beginning with :
"INSERT INTO wheat09.fields VALUES 
('687a86d7-8989-4572-a75b-d6b4e9a469b8', 'FORGERET 1', 2009, 0.00, 
10.07, 'profond', 'Blé tendre', [...]"
I have a crash in the ExecuteSQL function of ogr.py, line 343, that is 
expecting 'ascii', on the character 122 "é".

The string given to the ExecuteSQL function is of type Unicode String.

I don't want ExecuteSQL to expect ascii, but UTF-8. And from what I read from 
the GDAL homepage, it should be UTF-8....


I could read in the drv_pg.html page that :
"By default it is assumed that text being sent to Postgres is in the UTF-8 
encoding. This is fine for plain ASCII, but can result in errors for extended 
characters (ASCII 155+, LATIN1, etc). While OGR provides no direct control 
over this, you can set the PGCLIENTENCODING environment variable to indicate 
the format being provided. For instance, if your text is LATIN1 you could set 
the environment variable to LATIN1 before using OGR and input would be 
assumed to be LATIN1 instead of UTF-8."


Any suggestions or help is highly appreciated !

Regards,
Matthieu

-- 
Matthieu Rigal
Product Development

RapidEye AG                           Tel: +49-(0)3381-89 04 331
Molkenmarkt 30                       Fax: +49-(0)3381-89 04 101
14776 Brandenburg/Havel
Germany                                  http://www.rapideye.de

RapidEye AG
Molkenmarkt 30
14776 Brandenburg an der Havel
Germany

Head Office/Sitz der Gesellschaft: Brandenburg an der Havel
Management Board/Vorstand: Wolfgang G. Biedermann
Chairman of Supervisory Board/Vorsitzender des Aufsichtsrates: Axel Schmalz
Commercial Register/Handelsregister Potsdam HRB 17 796
Tax Number/Steuernummer: 048/100/00053
VAT-Ident-Number/Ust.-ID: DE 199331235
DIN EN ISO 9001 certified

*************************************************************************
Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese
E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den
Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie
die unbefugte Weitergabe dieser E-Mail ist nicht gestattet.

The information in this e-mail is intended for the named recipients
only. It may contain privileged and confidential information. If you
have received this communication in error, any use, copying or
dissemination of its contents is strictly prohibited. Please erase all
copies of the message along with any included attachments and notify
RapidEye AG or the sender immediately by telephone at the number
indicated on this page.


More information about the gdal-dev mailing list