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

Commit67f6b33

Browse files
committed
Make EUC_CN support more robust.
1 parent46645b9 commit67f6b33

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 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.11 2000/04/12 17:16:06momjian Exp $
4+
* $Id: wchar.c,v 1.11.2.1 2000/05/28 04:57:06ishii Exp $
55
*
66
* WIN1250 client encoding updated by Pavel Behal
77
*
@@ -166,7 +166,11 @@ pg_euccn_mblen(const unsigned char *s)
166166
{
167167
intlen;
168168

169-
if (*s&0x80)
169+
/* if the first byte > 0x80, then second byte must be > 0x80, also,
170+
* according to the EUC-CN standard. But in reality there are
171+
* so many broken EUC-CN data violating the rule. Sigh.
172+
*/
173+
if ((*s&0x80)&& (*(s+1)&0x80))
170174
len=2;
171175
else
172176
len=1;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp