Re: Bug #898: client_encoding can't support GB18030

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: dragzhb(at)yahoo(dot)com(dot)cn, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #898: client_encoding can't support GB18030
Date: 2003-02-22 08:52:05
Message-ID: 20030222.175205.74752345.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

> zzhb (dragzhb(at)yahoo(dot)com(dot)cn) reports a bug with a severity of 3
> The lower the number the more severe it is.
>
> Short Description
> client_encoding can't support GB18030 encoding in postgresql 7.3.1
>
> Long Description
> When I insert records using files, psql -f install.sql
>
> if I set PGCLIENTENCODING=GB18030, psql insert simplifed chinese incorrectly,but if I set PGCLIENTENCODING=GBK or unset PGCLIENTENCODING,psql insert simplifed chinese correctly.
>
> But when I use \encoding GB18030 to insert records in interactive psql,it can insert simplifed chinese correctly.

If you are setteing PGCLIENTENCODING before starting up postmaster, or
you are setting client_encoding in postgresql.conf, then that is a
known bug. Currently the fix is in current, but not in the 7.3 stable
tree to avoid the backward compatibilty with prior releases. This is
due to the fact that libpq calls pg_client_encoding() function which
is only available in 7.3 or later if you apply the fix.

If you need patches for 7.3.1, I could provie it for you, though they
would lose the backward compatibilty with prior releases.

> The following is my envirnoment.
>
> [postgres(at)hbzhang postgres]$ psql -l
> List of databases
> Name | Owner | Encoding
> -----------+----------+----------
> template0 | postgres | UNICODE
> template1 | postgres | UNICODE
> test | postgres | UNICODE
> (3 rows)
>
> [postgres(at)hbzhang postgres]$
> [postgres(at)hbzhang postgres]$ locale
> LANG=zh_CN.GB18030
> LC_CTYPE="zh_CN.GB18030"
> LC_NUMERIC="zh_CN.GB18030"
> LC_TIME="zh_CN.GB18030"
> LC_COLLATE="zh_CN.GB18030"
> LC_MONETARY="zh_CN.GB18030"
> LC_MESSAGES="zh_CN.GB18030"
> LC_PAPER="zh_CN.GB18030"
> LC_NAME="zh_CN.GB18030"
> LC_ADDRESS="zh_CN.GB18030"
> LC_TELEPHONE="zh_CN.GB18030"
> LC_MEASUREMENT="zh_CN.GB18030"
> LC_IDENTIFICATION="zh_CN.GB18030"
> LC_ALL=
> [postgres(at)hbzhang postgres]$
>
>
>
> [root(at)hbzhang root]# uname -a
> Linux hbzhang 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386 GNU/Linux
> [root(at)hbzhang root]#
>
> [root(at)hbzhang root]# pg_ctl --version
> pg_ctl (PostgreSQL) 7.3.1
> [root(at)hbzhang root]#
>
> Sample Code
>
>
> No file was uploaded with this report
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
x1

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Stephan Szabo 2003-02-22 17:41:46 Re: [SQL] 7.3 GROUP BY differs from 7.2
Previous Message Tom Lane 2003-02-22 08:05:32 Re: [SQL] 7.3 GROUP BY differs from 7.2