Thread: Encoding problem

Encoding problem

From
pgsql-bugs@postgresql.org
Date:
Danny Kao (danny.kao@autotools.com.tw) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
Encoding problem

Long Description
I have tried "initdb --encoding=BIG5"
then doing some create table and insert.
As shows below,it seems loss one byte "\",
and dumping data  is the same.
How could I got the right result?


Sample Code
Welcome to psql, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help on internal slash commands
       \g or terminate with semicolon to execute query
       \q to quit

template1=# \encoding
BIG5
template1=# create table a (a text);
CREATE
template1=# insert into a values('³\¦h');
INSERT 18761 1
template1=# select * from a;
  a
-----
 ³¦h
(1 row)

No file was uploaded with this report

Re: Encoding problem

From
Tatsuo Ishii
Date:
> Danny Kao (danny.kao@autotools.com.tw) reports a bug with a severity of 2
> The lower the number the more severe it is.
>
> Short Description
> Encoding problem
>
> Long Description
> I have tried "initdb --encoding=BIG5"

You cannot do that (documented in README.mb). If you want to use
traditional chinese do:

initdb --encoding=EUC_TW

instead.
--
Tatsuo Ishii

Re: Encoding problem

From
"danny"
Date:
Dear Sir :
      Thanx. After tried it again, it still couldn't work now.
      The result is the same error.
    *********************************************
 template1=# \encoding
EUC_TW
template1=# \z
Access permissions for database "template1"
 Relation | Access permissions
----------+--------------------
(0 rows)

template1=# create table a( a text);
CREATE
template1=# insert into a values('許多');
INSERT 18761 1
template1=# select * from a;
  a
-----
 釵h
(1 row)

template1=# insert into a values('許\多');
INSERT 18762 1
template1=# select * from a;
  a
------
 釵h
 許多
(2 rows)
 *********************************************
It seems it ate the "\" , so the word it appeared not the origin one.
                                                                      Danny

----- Original Message -----
From: "Tatsuo Ishii" <t-ishii@sra.co.jp>
To: <danny.kao@autotools.com.tw>; <pgsql-bugs@postgresql.org>
Sent: Wednesday, March 21, 2001 10:14 PM
Subject: Re: [BUGS] Encoding problem


> Danny Kao (danny.kao@autotools.com.tw) reports a bug with a severity of 2
> The lower the number the more severe it is.
>
> Short Description
> Encoding problem
>
> Long Description
> I have tried "initdb --encoding=BIG5"

You cannot do that (documented in README.mb). If you want to use
traditional chinese do:

initdb --encoding=EUC_TW

instead.
--
Tatsuo Ishii

Re: Encoding problem

From
Tatsuo Ishii
Date:
> Dear Sir :
>       Thanx. After tried it again, it still couldn't work now.
>       The result is the same error.
>     *********************************************
>  template1=# \encoding
> EUC_TW
> template1=# insert into a values('許\多');
> INSERT 18762 1

What is \261\\? It does not seem to be correct EUC_TW. Probably you
want to enter BIG5 from psql? The you should do like this:

\encoding BIG5
insert into a values('some big5 characters');

For the inserting value you should not use octal exporession but
should enter "raw" big5 characters.
--
Tatsuo Ishii