File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 11/*
22 * conversion functions between pg_wchar and multi-byte streams.
33 * Tatsuo Ishii
4- * $Id: wchar.c,v 1.23 2001/10/11 14:20:35 ishii Exp $
4+ * $Id: wchar.c,v 1.24 2001/10/15 01:19:15 ishii Exp $
55 *
66 * WIN1250 client encoding updated by Pavel Behal
77 *
@@ -537,11 +537,19 @@ pg_verifymbstr(const unsigned char *mbstr, int len)
537537 int slen = 0 ;
538538
539539 /* we do not check single byte encodings */
540- if (pg_encoding_max_length ( GetDatabaseEncoding () ) <= 1 )
540+ if (pg_database_encoding_max_length ( ) <= 1 )
541541 return NULL ;
542542
543543 while (len > 0 && * mbstr )
544544 {
545+ /* special UTF-8 check */
546+ if (GetDatabaseEncoding () == PG_UTF8 &&
547+ (* mbstr & 0xf8 ) == 0xf0 )
548+ {
549+ snprintf (buf , sizeof (buf ), "Unicode >= 0x10000 is not supoorted" );
550+ return (buf );
551+ }
552+
545553 l = pg_mblen (mbstr );
546554
547555 /* multi-byte letter? */
You can’t perform that action at this time.
0 commit comments