Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9e46767

Browse files
committed
The attached patch should be sufficient to fix libpgtcl. It requires
PostgreSQL to support unicode-conversion, but retains binarycompatibility among Tcl versions.However, it neither checks at compile time not at runtime, if supportfor unicode-conversion does really exist and it doesn't prevent theuser from changing the client encoding after initialization. I thinkthere should be warnings about this somewhere in the documentation.Reinhard Max
1 parent0ee85f8 commit9e46767

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎src/interfaces/libpgtcl/pgtcl.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtcl.c,v 1.21 2001/03/22 04:01:23 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtcl.c,v 1.22 2001/09/10 14:49:12 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -29,6 +29,7 @@
2929
int
3030
Pgtcl_Init(Tcl_Interp*interp)
3131
{
32+
doubletclversion;
3233

3334
/*
3435
* finish off the ChannelType struct. Much easier to do it here then
@@ -39,6 +40,13 @@ Pgtcl_Init(Tcl_Interp *interp)
3940
Pg_ConnType.getFileProc=PgGetFileProc;
4041
#endif
4142

43+
/*
44+
* Tcl versions >= 8.1 use UTF-8 for their internal string representation.
45+
* Therefore PGCLIENTENCODING must be set to UNICODE for these versions.
46+
*/
47+
Tcl_GetDouble(interp,Tcl_GetVar(interp,"tcl_version",TCL_GLOBAL_ONLY),&tclversion);
48+
if (tclversion >=8.1)setenv("PGCLIENTENCODING","UNICODE",1);
49+
4250
/* register all pgtcl commands */
4351
Tcl_CreateCommand(interp,
4452
"pg_conndefaults",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp