]> granicus.if.org Git - postgis/commitdiff
Support for multibyte field names in loader
authorSandro Santilli <strk@keybit.net>
Wed, 27 Jul 2005 02:47:06 +0000 (02:47 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 27 Jul 2005 02:47:06 +0000 (02:47 +0000)
git-svn-id: http://svn.osgeo.org/postgis/branches/pgis_1_0@1837 b70326c6-7e19-0410-871a-916f4a2858ee

CHANGES
loader/shp2pgsql.c

diff --git a/CHANGES b/CHANGES
index b0f5766f536aac80df0ed58e46754515dbe933f2..0b841e098eec6b4b315e666b29b3ef666a02d6e4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,12 +1,13 @@
 PostGIS 1.0.3
 ????/??/??
+       - Severe bugfix in lwgeom's 2d bounding box computation
        - Bugfix in WKT (-w) POINT handling in loader
        - Bugfix in dumper on 64bit machines
        - Bugfix in dumper handling of user-defined queries 
        - Bugfix in create_undef.pl script
        - Small performance improvement in canonical input function
        - Minor cleanups in loader
-       - Severe bugfix in lwgeom's 2d bounding box computation
+       - Support for multibyte field names in loader
 
 PostGIS 1.0.2
 2005/07/04
index b583e1d18b54b495a1016af572499111719f400f..81da08c5bc43bed02961515093a042cfaf8424ed 100644 (file)
@@ -1521,6 +1521,9 @@ GetFieldsSpec(void)
        char  name[MAXFIELDNAMELEN];
        char  name2[MAXFIELDNAMELEN];
        DBFFieldType type = -1;
+#ifdef USE_ICONV
+       char *utf8str;
+#endif
 
        num_fields = DBFGetFieldCount( hDBFHandle );
        num_records = DBFGetRecordCount(hDBFHandle);
@@ -1541,6 +1544,17 @@ GetFieldsSpec(void)
                widths[j] = field_width;
                precisions[j] = field_precision;
 
+#ifdef USE_ICONV
+               if ( encoding )
+               {
+                       utf8str = utf8(encoding, name);
+                       if ( ! utf8str ) exit(1);
+                       strcpy(name, utf8str);
+                       free(utf8str);
+               }
+#endif
+
+
                /*
                 * Make field names lowercase unless asked to
                 * keep identifiers case.
@@ -1577,7 +1591,7 @@ GetFieldsSpec(void)
                        }
                }       
 
-               field_names[j] = malloc ( strlen(name)+3 );
+               field_names[j] = malloc (strlen(name)+1);
                strcpy(field_names[j], name);
 
                sprintf(col_names, "%s\"%s\",", col_names, name);
@@ -1633,6 +1647,9 @@ utf8 (const char *fromcode, char *inputbuf)
 
 /**********************************************************************
  * $Log$
+ * Revision 1.88.2.5  2005/07/27 02:47:06  strk
+ * Support for multibyte field names in loader
+ *
  * Revision 1.88.2.4  2005/07/27 02:34:29  strk
  * Minor cleanups in loader
  *