]> granicus.if.org Git - postgis/commitdiff
Change default back to UTF8 and improve error message on failure.
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 26 May 2010 17:26:58 +0000 (17:26 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 26 May 2010 17:26:58 +0000 (17:26 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@5643 b70326c6-7e19-0410-871a-916f4a2858ee

loader/shp2pgsql-core.c
loader/shp2pgsql-core.h

index 096c85ee5e0e48a60b52083490521e40f7e2a3d3..d169e3811e99cb032c29b00a295b702945ec1fd8 100644 (file)
@@ -1573,7 +1573,8 @@ ShpLoaderGenerateSQLRowStatement(SHPLOADERSTATE *state, int item, char **strreco
                                utf8str = utf8(state->config->encoding, val);
                                if (!utf8str)
                                {
-                                       snprintf(state->message, SHPLOADERMSGLEN, "Unable to convert field value \"%s\" from %s encoding to UTF-8: iconv reports \"%s\"", val, state->config->encoding, strerror(errno));
+                                       snprintf(state->message, SHPLOADERMSGLEN, "Unable to convert field value \"%s\" to UTF-8 (iconv reports \"%s\"). Current encoding is \"%s\", try \"LATIN1\" (Western European), or one of the values described at http://www.postgresql.org/docs/current/static/multibyte.html.", val, strerror(errno), state->config->encoding);
+
                                        return SHPLOADERERR;
                                }
 
index 2cb0a298ab27ee30b9c4f978a0626e7ada42bd59..af8c07f844ed86b777a94591a7dddf4ae48cd08c 100644 (file)
@@ -68,7 +68,7 @@
 /*
  * Default character encoding
  */
-#define ENCODING_DEFAULT "LATIN1"
+#define ENCODING_DEFAULT "UTF8"
 
 /*
  * Structure to hold the loader configuration options