Bug #637: pltcl bug with multibyte support

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #637: pltcl bug with multibyte support
Date: 2002-04-20 09:04:18
Message-ID: 20020420090418.4F772475912@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Yury Don (yura(at)vpcit(dot)ru) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
pltcl bug with multibyte support

Long Description
I have a database with KOI8 encoding, many tables names and fields names contain cyrillic characters.
And I have a trigger on pltcl with the following code:
CREATE or replace FUNCTION log_event() RETURNS opaque AS '
foreach fld [array names NEW] {
elog DEBUG "field=${fld}"
}
return OK
}
' LANGUAGE 'pltcl';
In postgres 7.1 everything worked well, but in 7.2 I am getting an errors:
"NOTICE: utf_to_local: could not convert UTF-8 ..." for every field whose
name contains cyrillic characters. In postgresql.log there are string
field=<field name> for every field whose name doesn't contain cyrillic characters
and string field= for every field whose name contains cyrillic characters.
I removed converting utf to local code from pltcl.c (just replacing
#if defined(UNICODE_CONVERSION) && TCL_MAJOR_VERSION == 8 \
to
#if defined(UNICODE_CONVERSION_1) && TCL_MAJOR_VERSION == 8 \)
and now everything works well as it was in postgresql 7.1
My environment:
Debian Linux, Postgresql version 7.2.1 compiled with multibyte support
(--enable-unicode-conversion, --enable-multibyte, --enable-locale),
tcl version 8.3

Sample Code

No file was uploaded with this report

Browse pgsql-bugs by date

  From Date Subject
Next Message Gerhard Häring 2002-04-21 08:53:13 Escaping of special characters in ARRAYs is broken
Previous Message Dmitry Tkach 2002-04-19 20:24:00 Re: Patch for memory leaks in index scan