Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2a5180c

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 parent1ac1526 commit2a5180c

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
elseif ((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)

[8]ページ先頭

©2009-2025 Movatter.jp