Re: encoding names

From: Barry Lind <barry(at)xythos(dot)com>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: encoding names
Date: 2001-08-17 17:37:18
Message-ID: 3B7D564E.5030201@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

This patch will break the JDBC driver. The jdbc driver relies on the
value returned by getdatabaseencoding() to determine the server encoding
so that it can convert to unicode. This patch changes the return values
for getdatabaseencoding() such that the driver will no longer work. For
example "LATIN1" which used to be returned will now come back as
"iso88591". This change in behaviour impacts the JDBC driver and any
other application that is depending on the output of the
getdatabaseencoding() function.

I would recommend that getdatabaseencoding() return the old names for
backword compatibility and then deprecate this function to be removed in
the future. Then create a new function that returns the new encoding
names that can be used going forward.

thanks,
--Barry

Karel Zak wrote:
> Hi,
>
> attached is patch with:
>
> - new encoding names stuff with better performance (binary search
> intead for() and prevent some needless searching)
>
> - possible is use synonyms for encoding (an example ISO-8859-1,
> Latin1, l1)
>
> - implemented is Peter's idea about "encoding names clearing"
> (other chars than [A-Za-z0-9] are irrelevan -- 'ISO-8859-1' is
> same as 'iso8859_1' or iso-8-8-5-9-1 :-)
>
> - share routines for this between FE and BE (never more define
> encoding names separate in FE and BE)
>
> - add prefix PG_ to encoding identificator macros, something like 'ALT'
> is pretty dirty in source code, rather use PG_ALT.
>
> (Note: patch add new file mb/encname.c and remove mb/common.c)
>
> Karel
>
>
>
> ------------------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>
> Part 1.1
>
> Content-Type:
>
> text/plain
>
>
> ------------------------------------------------------------------------
> mb-08172001.patch.gz
>
> Content-Type:
>
> application/x-gzip
> Content-Encoding:
>
> base64
>
>
> ------------------------------------------------------------------------
> Part 1.3
>
> Content-Type:
>
> text/plain
> Content-Encoding:
>
> binary
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-08-17 17:46:27 Re: Dollar in identifiers
Previous Message Bruce Momjian 2001-08-17 17:34:32 Re: Re: [JDBC] JDBC pg_description update needed for CVS tip

Browse pgsql-patches by date

  From Date Subject
Next Message Mikhail Terekhov 2001-08-17 18:51:59 Re: [HACKERS] Re: WIN32 errno patch
Previous Message Bruce Momjian 2001-08-17 17:34:32 Re: Re: [JDBC] JDBC pg_description update needed for CVS tip