diff options
Diffstat (limited to 'src/port/chklocale.c')
-rw-r--r-- | src/port/chklocale.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/port/chklocale.c b/src/port/chklocale.c index 8fd092e2d6f..fcd3c6bb5b4 100644 --- a/src/port/chklocale.c +++ b/src/port/chklocale.c @@ -227,7 +227,7 @@ win32_langinfo(const char *ctype) * with any desired encoding. */ int -pg_get_encoding_from_locale(const char *ctype) +pg_get_encoding_from_locale(const char *ctype, bool write_message) { char *sys; int i; @@ -322,17 +322,20 @@ pg_get_encoding_from_locale(const char *ctype) * We print a warning if we got a CODESET string but couldn't recognize * it. This means we need another entry in the table. */ + if (write_message) + { #ifdef FRONTEND - fprintf(stderr, _("could not determine encoding for locale \"%s\": codeset is \"%s\""), - ctype, sys); - /* keep newline separate so there's only one translatable string */ - fputc('\n', stderr); + fprintf(stderr, _("could not determine encoding for locale \"%s\": codeset is \"%s\""), + ctype, sys); + /* keep newline separate so there's only one translatable string */ + fputc('\n', stderr); #else - ereport(WARNING, - (errmsg("could not determine encoding for locale \"%s\": codeset is \"%s\"", - ctype, sys), - errdetail("Please report this to <pgsql-bugs@postgresql.org>."))); + ereport(WARNING, + (errmsg("could not determine encoding for locale \"%s\": codeset is \"%s\"", + ctype, sys), + errdetail("Please report this to <pgsql-bugs@postgresql.org>."))); #endif + } free(sys); return -1; |