I suspect that data stored in your database was not EUC_CN. GB2312(or GBK) is different from EUC_CN. Can you show me the INSERT statement text in gzipped form to prevent accidental changes while relaying the mail chanin? -- Tatsuo Ishii > Hello, > > I am using Postgresql 7.1 on Linux platform (RedHat 7.1). > > My database encoding is 'EUC_CN'. > > The application is accessing database with PG JDBC2.0. > > I had define a field in a table like: > > create table test1 ( > > id integer default not null, > memo varchar(128) > > > ); > > The memo field is for user to record some comment or alike. They input Chinese >(GB2312 or GBK encoding) mixed with ASCII. > > Problem happens when: > > The length of the input string is larger than 128, and the 128th and 129th byte >consists of a Chinese character (you know Chinese characters use two bytes in GB2312 >or GBK encoding). > > The problem is: > > The insert query will be running well without any error. But the getString method >will get a zero length String from the field. > > More complications: > > When I pg_dump the database and restore it, the scripts produced by pg_dump (with -D >flag, which means dump with attribute) can not be restored. When I check the scripts >I found that the memo field of this record is dumped without the ending single quote >(this is because the 128th byte and the single quote followed acutally consists of >another unrecognized chinese character) and that is why it failed to be restored. > > Below is the dump for this record: > > INSERT INTO > "test1" ("id","memo") VALUES >(5,'¨°¨°¡Á??¡ì¨ª???¦Ì?¨º?¨°¨¤¨¦??¨®GH¦Ì£¤?a??¨¬????¨¤?¡Â¨°a¨º?5??1¨¨??¨¢3¨¨?¨°¨°¦Ì¨²¨°??¨®?a?¨¬¡ã2??¨¢?¨°???D??¡À1¡è?£¤¨¬?¨¢???¨¬¨¬¡ê?¨ª?¦Ì?¨º¡À????¡Á¡é¨°a?1?¨¦??¨º1¨°¦Ì?¡Â¨ª???¨°?¨°a?¨®?'); > > > > I feel the Multibyte is not properly handled in this case. Looking forward to >hearing from dev team. > > Finally I think PostgreSQL is an excellent database, but the name postgresql seems >very difficult to pronounce and it is probably one obstacle preventing people knowing >more about it. > > Thanks for the hardworking of the dev team, you have done excellent work! > > Best Regards, > > >
---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]