Re: A mb problem in PostgreSQL

Lists: pgsql-hackers
From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: cch(at)cc(dot)kmu(dot)edu(dot)tw
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: A mb problem in PostgreSQL
Date: 2000-12-07 04:47:10
Message-ID: 20001207134710R.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Chih-Chang,

> Do you remember the mb problem about Big5?

Sure.

> Now I have tested all Big5 chars (with ETen extension -- some chars in
> CNS 11643-1992 Plane 3) by the program in the attachment on
> PostgreSQL 7.0.3 with patches from you show me.
> The execution result is also in the attachment.
> The first two insertion fails are normal, because these two chars are
> duplicated in Big5.
> But the 3rd Big5 char (0xF9DC <- > CNS Plane3 0x4B5C) insertion
> is failed. I have no idea about why it is a "Unterminated quoted
> string".
> Could you see where the problem is?

Thanks for the testing effort!

Please apply following one-line-patch and test it again. If it's ok, I
will commit it to both current and stable trees.
--
Tatsuo Ishii

*** postgresql-7.0.3/src/backend/utils/mb/big5.c~ Thu May 27 00:19:54 1999
--- postgresql-7.0.3/src/backend/utils/mb/big5.c Thu Dec 7 13:39:01 2000
***************
*** 322,328 ****
if (b2c3[i][0] == big5)
{
*lc = LC_CNS11643_3;
! return (b2c3[i][1]);
}
}

--- 322,328 ----
if (b2c3[i][0] == big5)
{
*lc = LC_CNS11643_3;
! return (b2c3[i][1] | 0x8080U);
}
}


From: Chih-Chang Hsieh <cch(at)cc(dot)kmu(dot)edu(dot)tw>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: A mb problem in PostgreSQL
Date: 2000-12-09 01:15:20
Message-ID: 3A3187A8.F9C5F9B7@cc.kmu.edu.tw
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tatsuo,

Tatsuo Ishii 寫道:

> Please apply following one-line-patch and test it again. If it's ok, I
> will commit it to both current and stable trees.
>
> ! return (b2c3[i][1] | 0x8080U);

Yes, it's OK. Thank you!
But I wonder why we need to "| 0x8080U"?
b2c3[][] and BIG5toCNS()'s return value are both unsigned short, aren't they?

--
Chih-Chang Hsieh


From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: cch(at)cc(dot)kmu(dot)edu(dot)tw
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: A mb problem in PostgreSQL
Date: 2000-12-09 04:05:21
Message-ID: 20001209130521O.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> > Please apply following one-line-patch and test it again. If it's ok, I
> > will commit it to both current and stable trees.
> >
> > ! return (b2c3[i][1] | 0x8080U);
>
> Yes, it's OK. Thank you!
> But I wonder why we need to "| 0x8080U"?
> b2c3[][] and BIG5toCNS()'s return value are both unsigned short, aren't they?

b2c3 has CNS 11643-1992 value. That is, we need to add 0x8080 to
convert to EUC_TW.
--
Tatsuo Ishii


From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: cch(at)cc(dot)kmu(dot)edu(dot)tw
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: A mb problem in PostgreSQL
Date: 2000-12-09 04:21:39
Message-ID: 20001209132139O.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> > Please apply following one-line-patch and test it again. If it's ok, I
> > will commit it to both current and stable trees.
> >
> > ! return (b2c3[i][1] | 0x8080U);
>
> Yes, it's OK. Thank you!

Thanks for the testings. I will commit soon.

> But I wonder why we need to "| 0x8080U"?
> b2c3[][] and BIG5toCNS()'s return value are both unsigned short, aren't they?

Since the function returns EUC_TW. In b2c3[] we have CNS 11643-1992
value, and we need to add 0x8080 to convert from CNS 11643-1992 to
EUC.
--
Tatsuo Ishii