Skip to content

Commit e11cab6

Browse files
committed
Add hint for "invalid byte sequence for encoding" error message,
suggesting review of client_encoding.
1 parent daebd52 commit e11cab6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/backend/utils/mb/wchar.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* conversion functions between pg_wchar and multibyte streams.
33
* Tatsuo Ishii
4-
* $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.55 2006/05/21 20:05:19 tgl Exp $
4+
* $PostgreSQL: pgsql/src/backend/utils/mb/wchar.c,v 1.56 2006/08/22 03:30:20 momjian Exp $
55
*
66
* WIN1250 client encoding updated by Pavel Behal
77
*
@@ -1486,7 +1486,10 @@ report_invalid_encoding(int encoding, const char *mbstr, int len)
14861486
(errcode(ERRCODE_CHARACTER_NOT_IN_REPERTOIRE),
14871487
errmsg("invalid byte sequence for encoding \"%s\": 0x%s",
14881488
pg_enc2name_tbl[encoding].name,
1489-
buf)));
1489+
buf),
1490+
errhint("This failure can also happen if the byte sequence does not "
1491+
"match the encoding expected by the server, which is controlled "
1492+
"by \"client_encoding\".")));
14901493
}
14911494

14921495
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy