Re: encoding names v2. - Mailing list pgsql-patches
From | Barry Lind |
---|---|
Subject | Re: encoding names v2. |
Date | |
Msg-id | 3B83E6F2.80303@xythos.com Whole thread Raw |
In response to | encoding names v2. (Karel Zak <zakkr@zf.jcu.cz>) |
Responses |
Re: encoding names v2.
|
List | pgsql-patches |
Karel, If the only reason you are staying with the underscore in SQL_ACSII is because of the JDBC driver, don't worry about it. The code that calls pg_encoding_to_char() expecting SQL_ASCII is new code in the 7.2 trunk. It does not exist in 7.1, thus we are free to change it. Feel free to use a dash if you prefer. thanks, --Barry Karel Zak wrote: > Hi, > > all are almost same as in last version of this patch. Here are new > changes: > > - aliases cyrillic, cp819, ibm819, isoir100x, l1-4 are removed > - KOI8 is KOI8-R in *all* functions, maps, etc. > - WIN is window-1251 (WIN1251) --- // --- > - ALT is ALT :-) > - UNICODE is utf-8 > - PG_ prefix is used for all SQL_ASCII and the others > - fixed bug with --enable-unicode-conversion > > - getdatabaseencoding() is compatible with old versions, but > in the code is commented as deprecated. > > - getdbencoding() is new function that return correct encoding names > > test2=# select getdatabaseencoding(), getdbencoding(); > getdatabaseencoding | getdbencoding > ---------------------+--------------- > LATIN2 | ISO-8859-2 > (1 row) > > - pg_encoding_to_char() and other routines return new names! Only > for getdatabaseencoding() we keep back compatibility - needful for > JDBC. > > - all encoding names use '-'. I hope we will never see a problem with > it and some operator. Encoding names must be used as quoted string. > > Only for SQL_ASCII is used '_', because I see that JDBC has hardcoded > "pg_encoding_to_char(1) = 'SQL_ASCII'" :-((( > > - the ./configure.in: > * use new encoding names too for --enable-multibyte > * define MULTIBYTE that handle default encoding id > * define MULTIBYTE_NAME that handle default encoding name (neeful > for initdb) > > Note: old code use same names for macros and for encoding names, but > now it's in Makefile.global: > > MULTIBYTE = PG_KOI8R /* id */ > MULTIBYTE_NAME = "KOI8-R" /* name */ > > - the backend's createdb() function check correct BE encoding (here was > bug) > > - 'initdb' check if default template encoding is correct for backend DB. > > In the old code it's in initdb very hardcoded. I add to pg_encoding > option '-b' that check if encoding is correct for backend DB (means > encoding is not client only). It's better than > if [ $MULTIBYTEID -gt 31 ] > ^^^^^^ > in scripts. > > For example (Big5 is client only encoding): > > $ pg_encoding Big5 > 16 > $ pg_encoding -b Big5 > $ > > - initdb use MULTIBYTE_NAME and "pg_encoding -b" > > - ODBC works with old and new names for Shift_JIS and Big5 > > - the patch doesn't contain docs about encoding names... later :-) > > > Note for CVS commit: > > following files are renamed: > > src/utils/mb/Unicode/KOI8_to_utf8.map --> src/utils/mb/Unicode/KOI8R_to_utf8.map > src/utils/mb/Unicode/WIN_to_utf8.map --> src/utils/mb/Unicode/WIN1251_to_utf8.map > src/utils/mb/Unicode/utf8_to_KOI8.map --> src/utils/mb/Unicode/utf8_to_KOI8R.map > src/utils/mb/Unicode/utf8_to_WIN.map --> src/utils/mb/Unicode/utf8_to_WIN1251.map > > new file: > > src/utils/mb/encname.c > > removed file: > > src/utils/mb/common.c > > > The patch doesn't contain large configure script, but only configure.in. > Please before "cvs commit" do autoconf! > > > Thanks for all suggestion. > > New comments? > > Karel > > > > ------------------------------------------------------------------------ > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org > > Part 1.1 > > Content-Type: > > text/plain > > > ------------------------------------------------------------------------ > mb-08222001.patch.gz > > Content-Type: > > application/x-gzip > Content-Encoding: > > base64 > > > ------------------------------------------------------------------------ > Part 1.3 > > Content-Type: > > text/plain > Content-Encoding: > > binary > >
pgsql-patches by date: