pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
JDBC driver should use database encoding
4+ messages / 3 participants
[nested] [flat]

* JDBC driver should use database encoding
@ 1999-05-14 15:25 Martin Kuba <makub@inet.cz>
  1999-05-16 01:48 ` Re: [INTERFACES] JDBC driver should use database encoding Tatsuo Ishii <t-ishii@sra.co.jp>
  1999-05-17 17:53 ` Re: [INTERFACES] JDBC driver should use database encoding Peter T Mount <peter@retep.org.uk>
  1999-05-17 20:28 ` Re: [INTERFACES] JDBC driver should use database encoding Peter T Mount <peter@retep.org.uk>
  0 siblings, 3 replies; 4+ messages in thread

From: Martin Kuba @ 1999-05-14 15:25 UTC (permalink / raw)
  To: pgsql-interfaces

Hi,

Postgres 6.4.2 has multibyte support, so database can be
in one of several encodings. But the JDBC driver uses
for fetching data this method:
 
src/interfaces/jdbc/postgresql/ResultSet.java line 164:
return new String(this_row[columnIndex - 1]);

It means that not the database internal encoding, but 
the default encoding of client JVM will be used for
converting 8-bit characters to 16-bit UNICODE characters.

In postgres 6.5beta is the same code, so I think next
release will have the same bug.

Is it difficult to get the database encoding and use
it for converting bytes to Strings ? Is anybody planning
to do it ? If not, how can I do it ?

Martin
-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   INET, a.s.                          Mgr. Martin Kuba
Kralovopolska 139                  e-mail: makub@inet.cz
  601 12 Brno                      WWW: http://www.inet.cz/~makub/
 Czech Republic                    tel: +420-5-41242414/33
--------------------------------------------------------------------
PGP fingerprint = D8 57 47 E5 36 D2 C1 A1  C3 48 B2 59 00 58 42 27
 http://wwwkeys.cz.pgp.net:11371/pks/lookup?op=index&search=makub
--------------------------------------------------------------------



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [INTERFACES] JDBC driver should use database encoding
  1999-05-14 15:25 JDBC driver should use database encoding Martin Kuba <makub@inet.cz>
@ 1999-05-16 01:48 ` Tatsuo Ishii <t-ishii@sra.co.jp>
  2 siblings, 0 replies; 4+ messages in thread

From: Tatsuo Ishii @ 1999-05-16 01:48 UTC (permalink / raw)
  To: Martin Kuba <makub@inet.cz>; +Cc: pgsql-interfaces

> Postgres 6.4.2 has multibyte support, so database can be
> in one of several encodings. But the JDBC driver uses
> for fetching data this method:
>  
> src/interfaces/jdbc/postgresql/ResultSet.java line 164:
> return new String(this_row[columnIndex - 1]);
> 
> It means that not the database internal encoding, but 
> the default encoding of client JVM will be used for
> converting 8-bit characters to 16-bit UNICODE characters.
> 
> In postgres 6.5beta is the same code, so I think next
> release will have the same bug.
> 
> Is it difficult to get the database encoding and use
> it for converting bytes to Strings ? Is anybody planning
> to do it ? If not, how can I do it ?

Here in Japan we already have such a patch (for 6.4.2). I belive it
can be used for any language, but I will ask the author of the patch
to make sure that.
---
Tatsuo Ishii




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [INTERFACES] JDBC driver should use database encoding
  1999-05-14 15:25 JDBC driver should use database encoding Martin Kuba <makub@inet.cz>
@ 1999-05-17 17:53 ` Peter T Mount <peter@retep.org.uk>
  2 siblings, 0 replies; 4+ messages in thread

From: Peter T Mount @ 1999-05-17 17:53 UTC (permalink / raw)
  To: Martin Kuba <makub@inet.cz>; +Cc: pgsql-interfaces

On Fri, 14 May 1999, Martin Kuba wrote:

> Hi,
> 
> Postgres 6.4.2 has multibyte support, so database can be
> in one of several encodings. But the JDBC driver uses
> for fetching data this method:
>  
> src/interfaces/jdbc/postgresql/ResultSet.java line 164:
> return new String(this_row[columnIndex - 1]);
> 
> It means that not the database internal encoding, but 
> the default encoding of client JVM will be used for
> converting 8-bit characters to 16-bit UNICODE characters.
> 
> In postgres 6.5beta is the same code, so I think next
> release will have the same bug.
> 
> Is it difficult to get the database encoding and use
> it for converting bytes to Strings ? Is anybody planning
> to do it ? If not, how can I do it ?

I haven't had chance to look at Unicode support yet, but if you can think
of a way of implementing it without breaking 8bit support, I'd be
interested.

Peter

-- 
       Peter T Mount peter@retep.org.uk
      Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
 Java PDF Generator: http://www.retep.org.uk/pdf




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: [INTERFACES] JDBC driver should use database encoding
  1999-05-14 15:25 JDBC driver should use database encoding Martin Kuba <makub@inet.cz>
@ 1999-05-17 20:28 ` Peter T Mount <peter@retep.org.uk>
  2 siblings, 0 replies; 4+ messages in thread

From: Peter T Mount @ 1999-05-17 20:28 UTC (permalink / raw)
  To: Martin Kuba <makub@inet.cz>; +Cc: pgsql-interfaces

On Fri, 14 May 1999, Martin Kuba wrote:

> Hi,
> 
> Postgres 6.4.2 has multibyte support, so database can be
> in one of several encodings. But the JDBC driver uses
> for fetching data this method:
>  
> src/interfaces/jdbc/postgresql/ResultSet.java line 164:
> return new String(this_row[columnIndex - 1]);
> 
> It means that not the database internal encoding, but 
> the default encoding of client JVM will be used for
> converting 8-bit characters to 16-bit UNICODE characters.
> 
> In postgres 6.5beta is the same code, so I think next
> release will have the same bug.
> 
> Is it difficult to get the database encoding and use
> it for converting bytes to Strings ? Is anybody planning
> to do it ? If not, how can I do it ?

Guess what, I've just found a patch someone sent me earlier in the year,
implementing some Unicode support. If I get chance, I'll take a look at
it, but I don't think I'll get it into 6.5.

Peter

-- 
       Peter T Mount peter@retep.org.uk
      Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
 Java PDF Generator: http://www.retep.org.uk/pdf




^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~1999-05-17 20:28 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-05-14 15:25 JDBC driver should use database encoding Martin Kuba <makub@inet.cz>
1999-05-16 01:48 ` Tatsuo Ishii <t-ishii@sra.co.jp>
1999-05-17 17:53 ` Peter T Mount <peter@retep.org.uk>
1999-05-17 20:28 ` Peter T Mount <peter@retep.org.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox