--- generic/tclEncoding.c.orig	Fri Oct 26 13:17:17 2001
+++ generic/tclEncoding.c	Fri Oct 26 13:17:53 2001
@@ -2504,9 +2504,6 @@
 	memcpy((VOID *) dst, (VOID *) dataPtr->init,
 		(size_t) dataPtr->initLen);
 	dst += dataPtr->initLen;
-	memcpy((VOID *) dst, (VOID *) dataPtr->subTables[0].sequence,
-		(size_t) len);
-	dst += len;
     } else {
         state = (int) *statePtr;
     }
@@ -2594,6 +2591,14 @@
 	if (dst + dataPtr->finalLen > dstEnd) {
 	    result = TCL_CONVERT_NOSPACE;
 	} else {
+	    unsigned int len;
+
+	    len = dataPtr->subTables[0].sequenceLen;
+	    if (state != 0) {
+	      memcpy((VOID *) dst, (VOID *) dataPtr->subTables[0].sequence,
+		     (size_t) len);
+	      dst += len;
+	    }
 	    memcpy((VOID *) dst, (VOID *) dataPtr->final,
 		   (size_t) dataPtr->finalLen);
 	    dst += dataPtr->finalLen;
