*** empty log message ***
[idzebra-moved-to-github.git] / recctrl / regxread.c
index 73744fc..6fdbd89 100644 (file)
@@ -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);