Skip to content

Commit 2a5180c

Browse files
committed
Throw a warning rather than an error on invalid character from UTF8 to
Latin1, like we do for other Latin encodings.
1 parent 1ac1526 commit 2a5180c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c,v 1.13 2005/12/25 02:14:18 momjian Exp $
9+
* $PostgreSQL: pgsql/src/backend/utils/mb/conversion_procs/utf8_and_iso8859_1/utf8_and_iso8859_1.c,v 1.14 2006/02/12 21:15:19 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -84,8 +84,10 @@ utf8_to_iso8859_1(PG_FUNCTION_ARGS)
8484
len -= 2;
8585
}
8686
else if ((c & 0xe0) == 0xe0)
87-
elog(ERROR, "could not convert UTF8 character 0x%04x to ISO8859-1",
88-
c);
87+
ereport(WARNING,
88+
(errcode(ERRCODE_UNTRANSLATABLE_CHARACTER),
89+
errmsg("ignoring unconvertible UTF-8 character 0x%04x",
90+
c)));
8991
else
9092
{
9193
*dest++ = c;

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