From a1e5b8a23550070e86e70240c8f1cf54bed28838 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Wed, 26 May 2010 17:26:58 +0000 Subject: [PATCH] Change default back to UTF8 and improve error message on failure. git-svn-id: http://svn.osgeo.org/postgis/trunk@5643 b70326c6-7e19-0410-871a-916f4a2858ee --- loader/shp2pgsql-core.c | 3 ++- loader/shp2pgsql-core.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/loader/shp2pgsql-core.c b/loader/shp2pgsql-core.c index 096c85ee5..d169e3811 100644 --- a/loader/shp2pgsql-core.c +++ b/loader/shp2pgsql-core.c @@ -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; } diff --git a/loader/shp2pgsql-core.h b/loader/shp2pgsql-core.h index 2cb0a298a..af8c07f84 100644 --- a/loader/shp2pgsql-core.h +++ b/loader/shp2pgsql-core.h @@ -68,7 +68,7 @@ /* * Default character encoding */ -#define ENCODING_DEFAULT "LATIN1" +#define ENCODING_DEFAULT "UTF8" /* * Structure to hold the loader configuration options -- 2.40.0