From e11cab650c45f40b6f8a6b1874d149ca69b6cdc6 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 22 Aug 2006 03:30:20 +0000 Subject: [PATCH] Add hint for "invalid byte sequence for encoding" error message, suggesting review of client_encoding. --- src/backend/utils/mb/wchar.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/backend/utils/mb/wchar.c b/src/backend/utils/mb/wchar.c index 0cd1d31310..0a8d70fe8f 100644 --- a/src/backend/utils/mb/wchar.c +++ b/src/backend/utils/mb/wchar.c @@ -1,7 +1,7 @@ /* * conversion functions between pg_wchar and multibyte streams. * Tatsuo Ishii - * $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.55 2006/05/21 20:05:19 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.56 2006/08/22 03:30:20 momjian Exp $ * * WIN1250 client encoding updated by Pavel Behal * @@ -1486,7 +1486,10 @@ report_invalid_encoding(int encoding, const char *mbstr, int len) (errcode(ERRCODE_CHARACTER_NOT_IN_REPERTOIRE), errmsg("invalid byte sequence for encoding \"%s\": 0x%s", pg_enc2name_tbl[encoding].name, - buf))); + buf), + errhint("This failure can also happen if the byte sequence does not " + "match the encoding expected by the server, which is controlled " + "by \"client_encoding\"."))); } /* -- 2.11.0