A mb problem in PostgreSQL 
Author Message
 A mb problem in PostgreSQL

Chih-Chang,

Quote:
> Do you remember the mb problem about Big5?

Sure.

Quote:
> 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);
                        }
                }



Mon, 26 May 2003 13:09:18 GMT
 A mb problem in PostgreSQL

Tatsuo,

Tatsuo Ishii ?g1D?G

Quote:
> 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



Wed, 28 May 2003 09:15:42 GMT
 A mb problem in PostgreSQL

Quote:
> > 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


Wed, 28 May 2003 12:05:51 GMT
 A mb problem in PostgreSQL

Quote:
> > 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.

Quote:
> 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


Wed, 28 May 2003 12:29:04 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. PC 40MHz 600 MB 12 MB RAM $795

2. PC $795 40MHz 600 MB 12 MB RAM

3. File DBT da 50 Mb improvvisamente diventano enormi da 450 Mb (DBE)

4. Database TEMPDB mysteriously shrunk from 500 mb to 15 mb

5. PC $795 40MHz 600 MB 12 MB RAM

6. PC 40MHz 600 MB 12 MB RAM $795

7. Problem with Foxpro 2.6 extended for DOS and 100 Mb Ethernet network

8. Problem with Memo/Blob File (MB)

9. silly sp5a install problem - 3 MB

10. ANN: EMS PostgreSQL Query and PostgreSQL Extract released

11. Postgresql goes down need to restart (redhat postgresql service script) lock files removal avoid 2 postmasters

12. PostgreSQL Website : advocacy.postgresql.org


 
Powered by phpBB® Forum Software