File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
2
* conversion functions between pg_wchar and multi-byte streams.
3
3
* 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 $
5
5
*
6
6
* WIN1250 client encoding updated by Pavel Behal
7
7
*
@@ -537,11 +537,19 @@ pg_verifymbstr(const unsigned char *mbstr, int len)
537
537
int slen = 0 ;
538
538
539
539
/* we do not check single byte encodings */
540
- if (pg_encoding_max_length ( GetDatabaseEncoding () ) <= 1 )
540
+ if (pg_database_encoding_max_length ( ) <= 1 )
541
541
return NULL ;
542
542
543
543
while (len > 0 && * mbstr )
544
544
{
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
+
545
553
l = pg_mblen (mbstr );
546
554
547
555
/* multi-byte letter? */
You can’t perform that action at this time.
0 commit comments