[Dive4elements-commits] [PATCH 2 of 2] Importer: Use cp1252 instead of latin-9 to guess filename encodings

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


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1359373541 -3600
# Node ID 1f6e544f7a7fccf88bb03fcd5eac3d4468b3d8ce
# Parent  8e99d2d9364d207432a05b495ba1f85c990b79fb
Importer: Use cp1252 instead of latin-9 to guess filename encodings

diff -r 8e99d2d9364d -r 1f6e544f7a7f flys-backend/contrib/shpimporter/utils.py
--- a/flys-backend/contrib/shpimporter/utils.py	Mon Jan 28 12:44:41 2013 +0100
+++ b/flys-backend/contrib/shpimporter/utils.py	Mon Jan 28 12:45:41 2013 +0100
@@ -29,5 +29,5 @@
     try:
         return unicode.encode(unicode(path, sys.getfilesystemencoding()), "UTF-8")
     except UnicodeDecodeError:
-        # Probably Windows iso-8859-x names so lets try again
-        return unicode.encode(unicode(path, "iso-8859-15"), "UTF-8")
+        # Probably European Windows names so lets try again
+        return unicode.encode(unicode(path, "cp1252"), "UTF-8")


More information about the Dive4elements-commits mailing list