X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=recctrl%2Fregxread.c;h=6fdbd89b2ce47bd18af85a7bc04fd4922f903b54;hb=5adb31268b057741850de38eafd42baf8dc947ea;hp=73744fc44fc1b54485d8bac51235ee3684abd77e;hpb=08dfaf179e9c3bf0ec66a3a34fab11d5cd5d1fa8;p=idzebra-moved-to-github.git diff --git a/recctrl/regxread.c b/recctrl/regxread.c index 73744fc..6fdbd89 100644 --- a/recctrl/regxread.c +++ b/recctrl/regxread.c @@ -3,7 +3,13 @@ * All rights reserved. * * $Log: regxread.c,v $ - * Revision 1.35 2001-03-29 21:31:31 adam + * Revision 1.37 2001-05-29 08:51:59 adam + * More fixes for character encodings. + * + * Revision 1.36 2001/05/22 21:02:26 adam + * Fixes for Tcl UTF8 character handling. + * + * Revision 1.35 2001/03/29 21:31:31 adam * Fixed "record begin" for Tcl filter. * * Revision 1.34 2000/11/29 14:24:01 adam @@ -1401,7 +1407,14 @@ static int cmd_tcl_data (ClientData clientData, Tcl_Interp *interp, while (argi < argc) { +#if TCL_MAJOR_VERSION > 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION > 0) + Tcl_DString ds; + char *native = Tcl_UtfToExternalDString(0, argv[argi], -1, &ds); + execData (spec, native, strlen(native), textFlag); + Tcl_DStringFree (&ds); +#else execData (spec, argv[argi], strlen(argv[argi]), textFlag); +#endif argi++; } if (element) @@ -2092,7 +2105,9 @@ data1_node *grs_read_tcl (struct grs_read_info *p) if (*curLexSpec) lexSpecDestroy (curLexSpec); *curLexSpec = lexSpecCreate (p->type, p->dh); + Tcl_FindExecutable(""); tcl_interp = (*curLexSpec)->tcl_interp = Tcl_CreateInterp(); + Tcl_Init(tcl_interp); Tcl_CreateCommand (tcl_interp, "begin", cmd_tcl_begin, *curLexSpec, 0); Tcl_CreateCommand (tcl_interp, "end", cmd_tcl_end, *curLexSpec, 0); Tcl_CreateCommand (tcl_interp, "data", cmd_tcl_data, *curLexSpec, 0);