Re: character conversion problem about UTF-8-->SHIFT_JIS_2004

From: "bh yuan" <bhyuan(at)gmail(dot)com>
To: "Hiroshi Saito" <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>, pgsql-general(at)postgresql(dot)org
Subject: Re: character conversion problem about UTF-8-->SHIFT_JIS_2004
Date: 2008-02-13 05:35:37
Message-ID: 3c7b84c00802122135r59bf3a11t50de3232bd372c76@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

By use # \l ,the 7.4.3 version database show
List of databases
Name | Owner | Encoding
-----------+----------+-----------
testdbxx | userxxx | UNICODE
template0 | postgres | SQL_ASCII
template1 | postgres | SQL_ASCII
(3 rows)

I think [some character codes may not have a conversion table] is the reasion.
Now I occour 「〜」(0xefbd9e)、「―」(0xe28095)、「」(0xe9ab99) can not be
converted to SJIS without error message.

I convert the character to another SJIS character
by UPDATE tablexx SET fieldxx=replace(fieldxx,'\xef\xbd\x9e','~')
then I can export it as SJIS CSV file.
But it is not good idea, maybe I can config the setting file of postgresql8.3
or change the conversion table by myself ?

Thanks

2008/2/8, Hiroshi Saito <z-saito(at)guitar(dot)ocn(dot)ne(dot)jp>:
> Hi.
>
> >> use set client_encoding=''SJIS be the same to export PGCLIENTENCODING=SJIS.
> >>
> >> But can not export the data to csv file corecttly without errror,
> >> just because the character which is not SJIS encoding.
>
> Um, Please show the information on your database of 7.3.
>
> ex)
> postgres=# \l
> List of databases
> Name | Owner | Encoding
> -----------+----------+----------
> postgres | postgres | UTF8
> template0 | postgres | UTF8
> template1 | postgres | UTF8
> (3 rows)
>
> Probably, your database is SQL_ASCII ?
>
> Regards,
> Hiroshi Saito
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gevik Babakhani 2008-02-13 06:37:59 Re: Storing images as BYTEA or large objects
Previous Message Ken Johanson 2008-02-13 05:06:22 Re: SELECT CAST(123 AS char) -> 1