Skip to content
Snippets Groups Projects
Commit 2a5180c2 authored by Bruce Momjian's avatar Bruce Momjian
Browse files

Throw a warning rather than an error on invalid character from UTF8 to

Latin1, like we do for other Latin encodings.
parent 1ac1526e
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $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 $ * $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 $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -84,8 +84,10 @@ utf8_to_iso8859_1(PG_FUNCTION_ARGS) ...@@ -84,8 +84,10 @@ utf8_to_iso8859_1(PG_FUNCTION_ARGS)
len -= 2; len -= 2;
} }
else if ((c & 0xe0) == 0xe0) else if ((c & 0xe0) == 0xe0)
elog(ERROR, "could not convert UTF8 character 0x%04x to ISO8859-1", ereport(WARNING,
c); (errcode(ERRCODE_UNTRANSLATABLE_CHARACTER),
errmsg("ignoring unconvertible UTF-8 character 0x%04x",
c)));
else else
{ {
*dest++ = c; *dest++ = c;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment