[gdal-dev] Trouble with python+gdal+sqlite+utf-8 [SEC=UNCLASSIFIED]

Pinner, Luke Luke.Pinner at environment.gov.au
Sun Apr 17 19:51:18 EDT 2011


newFeature.SetField('name', u"Calle Garbí, 2".encode('utf-8'))

Luke  

-----Original Message-----
From: gdal-dev-bounces at lists.osgeo.org [mailto:gdal-dev-bounces at lists.osgeo.org] On Behalf Of Iván Sánchez Ortega
Sent: Monday, 18 April 2011 9:17 AM
To: gdal-dev at lists.osgeo.org
Subject: [gdal-dev] Trouble with python+gdal+sqlite+utf-8

Hi all,

I'm working with a script to do some data translation, and it seems it's 
failing when trying to set the value of a string attribute field to a UTF-8 
string.

I'm attaching a small script that reproduces the error (notice the "í" in 
"Calle Garbí"). If someone can point me to the right way to put a UTF-8 string 
into a SQLite string field, I'll pay him/her a beer during FOSS4G :-)


Best,
-- 
----------------------------------
Iván Sánchez Ortega <ivan at sanchezortega.es> <ivan at geonerd.org>

Intento ahogar mis penas... pero las jodidas flotan!

If you have received this transmission in error please notify us immediately by return e-mail and delete all copies. If this e-mail or any attachments have been sent to you in error, that error does not constitute waiver of any confidentiality, privilege or copyright in respect of information in the e-mail or attachments.

Please consider the environment before printing this email.


More information about the gdal-dev mailing list