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

Commitd07bacd

Browse files
committed
Add UTF-8 char >= 0x10000 check
1 parent9bc15d4 commitd07bacd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

‎src/backend/utils/mb/wchar.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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
intslen=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
returnNULL;
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? */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp