diff -r -c -P ./generic/tclEncoding.c.orig ./generic/tclEncoding.c
*** ./generic/tclEncoding.c.orig	Thu Apr 05 13:28:52 2001
--- ./generic/tclEncoding.c	Tue Dec 25 19:45:04 2001
***************
*** 2477,2487 ****
      dstEnd = dst + dstLen - 1;
  
      if (flags & TCL_ENCODING_START) {
- 	unsigned int len;
- 	
  	state = 0;
! 	len = dataPtr->subTables[0].sequenceLen;
! 	if (dst + dataPtr->initLen + len > dstEnd) {
  	    *srcReadPtr = 0;
  	    *dstWrotePtr = 0;
  	    return TCL_CONVERT_NOSPACE;
--- 2477,2484 ----
      dstEnd = dst + dstLen - 1;
  
      if (flags & TCL_ENCODING_START) {
  	state = 0;
! 	if (dst + dataPtr->initLen > dstEnd) {
  	    *srcReadPtr = 0;
  	    *dstWrotePtr = 0;
  	    return TCL_CONVERT_NOSPACE;
***************
*** 2489,2497 ****
  	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;
      }
--- 2486,2491 ----
***************
*** 2576,2584 ****
      }
  
      if ((result == TCL_OK) && (flags & TCL_ENCODING_END)) {
! 	if (dst + dataPtr->finalLen > dstEnd) {
  	    result = TCL_CONVERT_NOSPACE;
  	} else {
  	    memcpy((VOID *) dst, (VOID *) dataPtr->final,
  		    (size_t) dataPtr->finalLen);
  	    dst += dataPtr->finalLen;
--- 2570,2585 ----
      }
  
      if ((result == TCL_OK) && (flags & TCL_ENCODING_END)) {
! 	unsigned int len = dataPtr->subTables[0].sequenceLen;
! 	if (dst + dataPtr->finalLen + (state?len:0) > dstEnd) {
  	    result = TCL_CONVERT_NOSPACE;
  	} else {
+ 	    if ( state ) {
+ 	        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;

diff -r -c -P ./library/encoding/iso2022-jp.enc.orig ./library/encoding/iso2022-jp.enc
*** ./library/encoding/iso2022-jp.enc.orig	Thu Oct 04 13:22:30 2001
--- ./library/encoding/iso2022-jp.enc	Tue Dec 25 19:46:38 2001
***************
*** 5,12 ****
  final		{}
  iso8859-1	\x1b(B
  jis0201		\x1b(J
- jis0208		\x1b$@
  jis0208		\x1b$B
  jis0212		\x1b$(D
  gb2312		\x1b$A
  ksc5601		\x1b$(C
--- 5,12 ----
  final		{}
  iso8859-1	\x1b(B
  jis0201		\x1b(J
  jis0208		\x1b$B
+ jis0208		\x1b$@
  jis0212		\x1b$(D
  gb2312		\x1b$A
  ksc5601		\x1b$(C
