Re: pgAdmin2 Japanese display

From: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
To: jm(dot)poure(at)freesurf(dot)fr
Cc: pgsql-odbc(at)postgresql(dot)org, pgadmin-hackers(at)postgresql(dot)org
Subject: Re: pgAdmin2 Japanese display
Date: 2002-02-26 05:24:23
Message-ID: 3C7B1C07.EB2DF8B6@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgsql-odbc

Jean-Michel POURE wrote:
>
> Le Lundi 25 F騅rier 2002 17:19, Hiroshi Inoue a 馗rit :
> > SET CLIENT_ENCODING to 'SJIS'
> > Strictly speaking, you need a multibyte psqlodbc driver
> > to handle SJIS(Shift Jis) properly.
>
> Dear Hiroshi,
>
> Thank you for your answer. Could you tell us more about SJIS:
> 1) Is it Microsoft encoding standard for Japanese?

Yes. You can see SJIS Japanese strings if you set the locale
*Japanese*.

> 2) Is the multibyte psqlodbc driver a separate driver?

Yes and no. You could build the multibyte driver with
the same source but the different compile option.

> What are the
> settings to switch odbc to SJIS?

Please set the connect_settings DSN option as
set client_encoding to 'SJIS'.
The commands are issued immediately after the connection
was established and you can see SJIS(converted from EUC_JP,
UTF-8 etc) Japanese strings. Note that you can see the strings
properly in most cases even though you don't use the multibyte
driver. However SJIS could have ASCII(e.g. \, { ) byte as
the second byte of some multibyte characters and they sometimes
confuses non-multibyte psqlodbc driver. It occurs with neither
EUC_XX nor UTF-8 because every byte of their multibyte characters
is non-ASCII.

> Do you think it would be usefull to convert UTF-8 into UCS-2 using:
> SET CLIENT_ENCODING to 'UCS-2'.

The *SET CLIENT_ENCODING .. * command is to request the
server to convert every server side text string(server encoding)
to the specified client_encoding when retrieving the text strings
at the client side. However currently(maybe in the future also)
PostgreSQL doesn't support any UCS-2 <-> .. conversion.
The main reason is that all currently supported encodings contain
ASCII as a part of themselves and they are always teminated by
NULL('\0') but UCS-2 satisfies neither.
To support Unicode(UCS-2) in our ODBC driver we would
have to implement the APIs for Unicode like
SQLColAttributesW, SQLColumnPrivilegesW, SQLColumnsW,
SQLConnectW, SQLDataSourcesW, SQLDescribeColW,
SQLDriverConnectW, SQLErrorW, SQLExecDirectW,
SQLForeignKeysW, SQLGetConnectOptionW,
SQLGetCursorNameW, SQLGetInfoW, SQLNativeSqlW,
SQLPrepareW, SQLPrimaryKeysW, SQLProcedureColumnsW,
SQLProceduresW, SQLSetConnectOptionW, SQLSetCursorNameW,
SQLSpecialColumnsW, SQLStatisticsW, SQLTablesW,
SQLTablePrivilegesW
and handle SQL_WCHAR and SQL_C_WCHAR at various(not
clear now) places using UCS-2 <-> UTF-8 conversion.

regards,
Hiroshi Inoue

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2002-02-26 05:51:14 Re: pgAdmin2 Japanese display
Previous Message Jean-Michel POURE 2002-02-25 21:07:18 Re: Database->ServerEncoding, ClientEncoding

Browse pgsql-odbc by date

  From Date Subject
Next Message Hiroshi Inoue 2002-02-26 05:51:14 Re: pgAdmin2 Japanese display
Previous Message Dave Page 2002-02-25 20:14:08 Re: pgAdmin2 Japanese display