[Dive4elements-commits] [PATCH 07 of 15] (importer) Try to convert paths to UTF-8 for DB insertion

Wald Commits scm-commit at wald.intevation.org
Mon Jan 28 12:27:34 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1359107098 -3600
# Node ID 852d4c508f33c3dcbb0977e6b43ff648c0341761
# Parent  884afa1491928cbddf0da834e67c519af285dacd
(importer) Try to convert paths to UTF-8 for DB insertion

diff -r 884afa149192 -r 852d4c508f33 flys-backend/contrib/shpimporter/importer.py
--- a/flys-backend/contrib/shpimporter/importer.py	Fri Jan 25 10:43:38 2013 +0100
+++ b/flys-backend/contrib/shpimporter/importer.py	Fri Jan 25 10:44:58 2013 +0100
@@ -4,6 +4,7 @@
     import ogr
 import osr
 import shpimporter
+import utils
 
 class Importer:
 
@@ -114,7 +115,7 @@
                                                 path=path)
 
                 if newFeat is not None:
-                    newFeat.SetField("path", path)
+                    newFeat.SetField("path", utils.getUTF8Path(path))
                     newFeat = self.transform(newFeat)
                     res = destLayer.CreateFeature(newFeat)
                     if res is None or res > 0:


More information about the Dive4elements-commits mailing list