diff --git a/src/xercesc/util/Transcoders/Cygwin/CygwinTransService.cpp b/src/xercesc/util/Transcoders/Cygwin/CygwinTransService.cpp
index 0e71b22ad6a3fd568bc401ea0acd9c7727341729..b4d1c4b2fb5406bbf65ab53e0eb7497c21244df5 100644
--- a/src/xercesc/util/Transcoders/Cygwin/CygwinTransService.cpp
+++ b/src/xercesc/util/Transcoders/Cygwin/CygwinTransService.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.8  2003/05/17 16:32:17  knoaman
+ * Memory manager implementation : transcoder update.
+ *
  * Revision 1.7  2003/05/16 14:04:46  neilg
  * fix compilation error
  *
@@ -224,7 +227,10 @@ CPMapEntry::CPMapEntry( const   char* const     encodingName
     // Transcode the name to Unicode and store that copy
     const unsigned int srcLen = strlen(encodingName);
     const unsigned int targetLen = ::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, encodingName, srcLen, NULL, 0);
-    fEncodingName = new XMLCh[targetLen + 1];
+    fEncodingName = (XMLCh*) XMLPlatformUtils::fgMemoryManager->allocate
+    (
+        (targetLen + 1) * sizeof(XMLCh)
+    );//new XMLCh[targetLen + 1];
     ::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, encodingName, srcLen, (LPWSTR)fEncodingName, targetLen);
     fEncodingName[targetLen] = 0;
 
@@ -243,7 +249,7 @@ CPMapEntry::CPMapEntry( const   XMLCh* const    encodingName
     , fCPId(cpId)
     , fIEId(ieId)
 {
-    fEncodingName = XMLString::replicate(encodingName);
+		fEncodingName = XMLString::replicate(encodingName, XMLPlatformUtils::fgMemoryManager);
 
     //
     //  Upper case it because we are using a hash table and need to be
@@ -255,7 +261,7 @@ CPMapEntry::CPMapEntry( const   XMLCh* const    encodingName
 
 CPMapEntry::~CPMapEntry()
 {
-    delete [] fEncodingName;
+    XMLPlatformUtils::fgMemoryManager->deallocate(fEncodingName);//delete [] fEncodingName;
 }
 
 
@@ -457,7 +463,10 @@ CygwinTransService::CygwinTransService()
         {
             const unsigned int srcLen = strlen(aliasBuf);
             const unsigned int targetLen = ::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, aliasBuf, srcLen, NULL, 0);
-            XMLCh* uniAlias = new XMLCh[targetLen + 1];
+            XMLCh* uniAlias = (XMLCh*) XMLPlatformUtils::fgMemoryManager->allocate
+            (
+                (targetLen + 1) * sizeof(XMLCh)
+            );//new XMLCh[targetLen + 1];
             ::MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, aliasBuf, srcLen, (LPWSTR)uniAlias, targetLen);
             uniAlias[targetLen] = 0;
             ::LCMapStringW( gLocaleId, LCMAP_UPPERCASE, (LPCWSTR)uniAlias, targetLen, (LPWSTR)uniAlias, targetLen);
@@ -477,7 +486,7 @@ CygwinTransService::CygwinTransService()
                     fCPMap->put((void*)newEntry->getEncodingName(), newEntry);
                 }
             }
-            delete [] uniAlias;
+            XMLPlatformUtils::fgMemoryManager->deallocate(uniAlias);//delete [] uniAlias;
         }
 
         // And now close the subkey handle and bump the subkey index
@@ -551,8 +560,14 @@ int CygwinTransService::auxCompareString( const XMLCh* const comp1
     if ( ignoreCase )
     {
         // Copy const parameter strings (plus terminating nul) into locals.
-        firstBuf = new XMLCh[ ++len];
-        secondBuf = new XMLCh[ ++otherLen];
+        firstBuf = (XMLCh*) XMLPlatformUtils::fgMemoryManager->allocate
+        (
+            (++len) * sizeof(XMLCh)
+        );//new XMLCh[ ++len];
+        secondBuf = (XMLCh*) XMLPlatformUtils::fgMemoryManager->allocate
+        (
+            (++otherLen) * sizeof(XMLCh)
+        );//new XMLCh[ ++otherLen];
         memcpy( firstBuf, comp1, len * sizeof(XMLCh));
         memcpy( secondBuf, comp2, otherLen * sizeof(XMLCh));
 
@@ -579,8 +594,8 @@ int CygwinTransService::auxCompareString( const XMLCh* const comp1
     // Clean-up buffers, equivalent to if ( ignoreCase )
     if ( firstBuf )
     {
-        delete [] firstBuf;
-        delete [] secondBuf;
+        XMLPlatformUtils::fgMemoryManager->deallocate(firstBuf);//delete [] firstBuf;
+        XMLPlatformUtils::fgMemoryManager->deallocate(secondBuf);//delete [] secondBuf;
     }
 
     return theResult;
@@ -719,6 +734,7 @@ CygwinTransService::makeNewXMLTranscoder(const   XMLCh* const           encoding
         , theEntry->getWinCP()
         , theEntry->getIEEncoding()
         , blockSize
+        , manager
     );
 }
 
@@ -742,9 +758,10 @@ CygwinTransService::makeNewXMLTranscoder(const   XMLCh* const           encoding
 CygwinTranscoder::CygwinTranscoder(const  XMLCh* const    encodingName
                                 , const unsigned int    winCP
                                 , const unsigned int    ieCP
-                                , const unsigned int    blockSize) :
+                                , const unsigned int    blockSize
+                                , MemoryManager* const manager) :
 
-    XMLTranscoder(encodingName, blockSize)
+    XMLTranscoder(encodingName, blockSize, manager)
     , fIECP(ieCP)
     , fWinCP(winCP)
 {
diff --git a/src/xercesc/util/Transcoders/Cygwin/CygwinTransService.hpp b/src/xercesc/util/Transcoders/Cygwin/CygwinTransService.hpp
index 36535b23dedc8732d38ddcf36dc5729cc355bdd4..cde02f657492101de0ee8413d962f4ac68bd2255 100644
--- a/src/xercesc/util/Transcoders/Cygwin/CygwinTransService.hpp
+++ b/src/xercesc/util/Transcoders/Cygwin/CygwinTransService.hpp
@@ -179,7 +179,8 @@ public :
         const   XMLCh* const    encodingName
         , const unsigned int    winCP
         , const unsigned int    ieCP
-        , const unsigned int    blockSize);
+        , const unsigned int    blockSize
+        , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager);
     ~CygwinTranscoder();
 
 
diff --git a/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp b/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp
index 39c342361254b5fdba0939c4306b2428cf8d90db..06ba6c77ba34253a2478a8fab9203e09ac514e8f 100644
--- a/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp
+++ b/src/xercesc/util/Transcoders/ICU/ICUTransService.cpp
@@ -126,10 +126,13 @@ static UChar* convertToUChar( const   XMLCh* const    toConvert
 }
 
 
-static XMLCh* convertToXMLCh(const UChar* const toConvert)
+static XMLCh* convertToXMLCh( const UChar* const toConvert,
+                            , MemoryManager* const manager = 0)
 {
     const unsigned int srcLen = u_strlen(toConvert);
-    XMLCh* retBuf = new XMLCh[srcLen + 1];
+    XMLCh* retBuf = (manager)
+        ? (XMLCh*) manager->allocate((srcLen+1) sizeof(XMLCh))
+        : new XMLCh[srcLen + 1];
 
     XMLCh* outPtr = retBuf;
     const UChar* srcPtr = toConvert;
@@ -348,13 +351,13 @@ makeNewXMLTranscoder(const  XMLCh* const            encodingName
     {
         actualName = (const UChar*)encodingName;
     }
-     else
+    else
     {
-        tmpName = convertToUChar(encodingName);
+        tmpName = convertToUChar(encodingName, 0, XMLPlatformUtils::fgMemoryManager);
         actualName = tmpName;
     }
 
-    ArrayJanitor<UChar> janTmp(tmpName);
+    ArrayJanitor<UChar> janTmp(tmpName, XMLPlatformUtils::fgMemoryManager);
 
     UErrorCode uerr = U_ZERO_ERROR;
     UConverter* converter = ucnv_openU(actualName, &uerr);
@@ -364,7 +367,7 @@ makeNewXMLTranscoder(const  XMLCh* const            encodingName
         return 0;
     }
 
-    return new (manager) ICUTranscoder(encodingName, converter, blockSize);
+    return new (manager) ICUTranscoder(encodingName, converter, blockSize, manager);
 }
 
 
@@ -375,16 +378,20 @@ makeNewXMLTranscoder(const  XMLCh* const            encodingName
 // ---------------------------------------------------------------------------
 ICUTranscoder::ICUTranscoder(const  XMLCh* const        encodingName
                             ,       UConverter* const   toAdopt
-                            , const unsigned int        blockSize) :
+                            , const unsigned int        blockSize
+                            , MemoryManager* const      manager) :
 
-    XMLTranscoder(encodingName, blockSize)
+    XMLTranscoder(encodingName, blockSize, manager)
     , fConverter(toAdopt)
     , fFixed(false)
     , fSrcOffsets(0)
 {
     // If there is a block size, then allocate our source offset array
     if (blockSize)
-        fSrcOffsets = new XMLUInt32[blockSize];
+        fSrcOffsets = (XMLUInt32*) manager->allocate
+        (
+            blockSize * sizeof(XMLUInt32)
+        );//new XMLUInt32[blockSize];
 
     // Remember if its a fixed size encoding
     fFixed = (ucnv_getMaxCharSize(fConverter) == ucnv_getMinCharSize(fConverter));
@@ -392,7 +399,7 @@ ICUTranscoder::ICUTranscoder(const  XMLCh* const        encodingName
 
 ICUTranscoder::~ICUTranscoder()
 {
-    delete [] fSrcOffsets;
+    getMemoryManager()->deallocate(fSrcOffsets);//delete [] fSrcOffsets;
 
     // If there is a converter, ask ICU to clean it up
     if (fConverter)
@@ -432,7 +439,10 @@ ICUTranscoder::transcodeFrom(const  XMLByte* const          srcData
     if (sizeof(XMLCh) == sizeof(UChar))
         startTarget = (UChar*)toFill;
      else
-        startTarget = new UChar[maxChars];
+        startTarget = (UChar*) getMemoryManager()->allocate
+        (
+            maxChars * sizeof(UChar)
+        );//new UChar[maxChars];
     UChar* orgTarget = startTarget;
 
     //
@@ -456,7 +466,7 @@ ICUTranscoder::transcodeFrom(const  XMLByte* const          srcData
     if ((err != U_ZERO_ERROR) && (err != U_BUFFER_OVERFLOW_ERROR))
     {
         if (orgTarget != (UChar*)toFill)
-            delete [] orgTarget;
+            getMemoryManager()->deallocate(orgTarget);//delete [] orgTarget;
 
         if (fFixed)
         {
@@ -470,7 +480,7 @@ ICUTranscoder::transcodeFrom(const  XMLByte* const          srcData
                 , getEncodingName()
             );
         }
-         else
+        else
         {
             ThrowXML(TranscodingException, XMLExcepts::Trans_BadSrcSeq);
         }
@@ -534,7 +544,7 @@ ICUTranscoder::transcodeFrom(const  XMLByte* const          srcData
             *outPtr++ = XMLCh(*startTarget++);
 
         // And delete the temp buffer
-        delete [] orgTarget;
+        getMemoryManager()->deallocate(orgTarget);//delete [] orgTarget;
     }
 
     // Return the chars we put into the target buffer
@@ -561,12 +571,12 @@ ICUTranscoder::transcodeTo( const   XMLCh* const    srcData
     {
         srcPtr = (const UChar*)srcData;
     }
-     else
+    else
     {
-        tmpBufPtr = convertToUChar(srcData, srcCount);
+        tmpBufPtr = convertToUChar(srcData, srcCount, getMemoryManager());
         srcPtr = tmpBufPtr;
     }
-    ArrayJanitor<UChar> janTmpBuf(tmpBufPtr);
+    ArrayJanitor<UChar> janTmpBuf(tmpBufPtr, getMemoryManager());
 
     //
     //  Set the appropriate callback so that it will either fail or use
@@ -765,11 +775,11 @@ unsigned int ICULCPTranscoder::calcRequiredSize(const XMLCh* const srcText)
             );
         }
     }
-     else
+    else
     {
         // Copy the source to a local temp
-        UChar* tmpBuf = convertToUChar(srcText);
-        ArrayJanitor<UChar> janTmp(tmpBuf);
+        UChar* tmpBuf = convertToUChar(srcText, 0, XMLPlatformUtils::fgMemoryManager);
+        ArrayJanitor<UChar> janTmp(tmpBuf, XMLPlatformUtils::fgMemoryManager);
 
         // Use a faux scope to synchronize while we do this
         {
@@ -863,12 +873,12 @@ char* ICULCPTranscoder::transcode(const XMLCh* const toTranscode)
      else
     {
         // Allocate a non-const temp buf, but store it also in the actual
-        ncActual = convertToUChar(toTranscode);
+        ncActual = convertToUChar(toTranscode, 0, XMLPlatformUtils::fgMemoryManager);
         actualSrc = ncActual;
     }
 
     // Insure that the temp buffer, if any, gets cleaned up via the nc pointer
-    ArrayJanitor<UChar> janTmp(ncActual);
+    ArrayJanitor<UChar> janTmp(ncActual, XMLPlatformUtils::fgMemoryManager);
 
     // Caculate a return buffer size not too big, but less likely to overflow
     int32_t targetLen = (int32_t)(srcLen * 1.25);
@@ -942,7 +952,7 @@ char* ICULCPTranscoder::transcode(const XMLCh* const toTranscode,
 
     if (!*toTranscode)
     {
-        retBuf = new char[1];
+        retBuf = (char*) manager->allocate(sizeof(char));//new char[1];
         retBuf[0] = 0;
         return retBuf;
     }
@@ -966,18 +976,18 @@ char* ICULCPTranscoder::transcode(const XMLCh* const toTranscode,
      else
     {
         // Allocate a non-const temp buf, but store it also in the actual
-        ncActual = convertToUChar(toTranscode);
+        ncActual = convertToUChar(toTranscode, 0, manager);
         actualSrc = ncActual;
     }
 
     // Insure that the temp buffer, if any, gets cleaned up via the nc pointer
-    ArrayJanitor<UChar> janTmp(ncActual);
+    ArrayJanitor<UChar> janTmp(ncActual, manager);
 
     // Caculate a return buffer size not too big, but less likely to overflow
     int32_t targetLen = (int32_t)(srcLen * 1.25);
 
     // Allocate the return buffer
-    retBuf = new char[targetLen + 1];
+    retBuf = (char*) manager->allocate((targetLen + 1) * sizeof(char));//new char[targetLen + 1];
 
     //
     //  Lock now while we call the converter. Use a faux block to do the
@@ -1007,8 +1017,8 @@ char* ICULCPTranscoder::transcode(const XMLCh* const toTranscode,
         //  and try again.
         //
         err = U_ZERO_ERROR;
-        delete [] retBuf;
-        retBuf = new char[targetCap + 1];
+        manager->deallocate(retBuf);//delete [] retBuf;
+        retBuf = (char*) manager->allocate((targetCap + 1) * sizeof(char));//new char[targetCap + 1];
 
         // Lock again before we retry
         XMLMutexLock lockConverter(&fMutex);
@@ -1025,7 +1035,7 @@ char* ICULCPTranscoder::transcode(const XMLCh* const toTranscode,
 
     if (U_FAILURE(err))
     {
-        delete [] retBuf;
+        manager->deallocate(retBuf);//delete [] retBuf;
         return 0;
     }
 
@@ -1131,7 +1141,7 @@ XMLCh* ICULCPTranscoder::transcode(const char* const toTranscode,
 
     if (!*toTranscode)
     {
-        XMLCh* retVal = new XMLCh[1];
+        XMLCh* retVal = (XMLCh*) manager->allocate(sizeof(XMLCh));//new XMLCh[1];
         retVal[0] = 0;
         return retVal;
     }
@@ -1171,7 +1181,7 @@ XMLCh* ICULCPTranscoder::transcode(const char* const toTranscode,
             return 0;
 
         err = U_ZERO_ERROR;
-        targetBuf = new UChar[targetCap + 1];
+        targetBuf = (UChar*) manager->allocate((targetCap+1) * sizeof(UChar));//new UChar[targetCap + 1];
         ucnv_toUChars
         (
             fConverter
@@ -1186,7 +1196,7 @@ XMLCh* ICULCPTranscoder::transcode(const char* const toTranscode,
     if (U_FAILURE(err))
     {
         // Clean up if we got anything allocated
-        delete [] targetBuf;
+        manager->deallocate(targetBuf);//delete [] targetBuf;
         return 0;
     }
 
@@ -1205,8 +1215,8 @@ XMLCh* ICULCPTranscoder::transcode(const char* const toTranscode,
     }
      else
     {
-        actualRet = convertToXMLCh(targetBuf);
-        delete [] targetBuf;
+        actualRet = convertToXMLCh(targetBuf, manager);
+        manager->deallocate(targetBuf);//delete [] targetBuf;
     }
     return actualRet;
 }
@@ -1240,7 +1250,10 @@ bool ICULCPTranscoder::transcode(const  char* const     toTranscode
     if (sizeof(XMLCh) == sizeof(UChar))
         targetBuf = (UChar*)toFill;
     else
-        targetBuf = new UChar[maxChars + 1];
+        targetBuf = (UChar*) XMLPlatformUtils::fgMemoryManager->allocate
+        (
+            (maxChars + 1) * sizeof(UChar)
+        );//new UChar[maxChars + 1];
 
     //
     //  Use a faux block to enforce a lock on the converter, which will
@@ -1263,7 +1276,7 @@ bool ICULCPTranscoder::transcode(const  char* const     toTranscode
     if (U_FAILURE(err))
     {
         if (targetBuf != (UChar*)toFill)
-            delete [] targetBuf;
+            XMLPlatformUtils::fgMemoryManager->deallocate(targetBuf);//delete [] targetBuf;
         return false;
     }
 
@@ -1277,7 +1290,7 @@ bool ICULCPTranscoder::transcode(const  char* const     toTranscode
         *outPtr = 0;
 
         // And delete the temp buffer
-        delete [] targetBuf;
+        XMLPlatformUtils::fgMemoryManager->deallocate(targetBuf);//delete [] targetBuf;
     }
 
     return true;
@@ -1314,12 +1327,12 @@ bool ICULCPTranscoder::transcode(   const   XMLCh* const    toTranscode
      else
     {
         // Allocate a non-const temp buf, but store it also in the actual
-        ncActual = convertToUChar(toTranscode);
+        ncActual = convertToUChar(toTranscode, 0, XMLPlatformUtils::fgMemoryManager);
         actualSrc = ncActual;
     }
 
     // Insure that the temp buffer, if any, gets cleaned up via the nc pointer
-    ArrayJanitor<UChar> janTmp(ncActual);
+    ArrayJanitor<UChar> janTmp(ncActual, XMLPlatformUtils::fgMemoryManager);
 
     //
     //  Use a faux block to enforce a lock on the converter while we do this.
diff --git a/src/xercesc/util/Transcoders/ICU/ICUTransService.hpp b/src/xercesc/util/Transcoders/ICU/ICUTransService.hpp
index a56ad59feb8b0e69a16a639e8c185e5d191eeac1..e3c5684679b44d13bb6f15c6c276247b31f41f7c 100644
--- a/src/xercesc/util/Transcoders/ICU/ICUTransService.hpp
+++ b/src/xercesc/util/Transcoders/ICU/ICUTransService.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.8  2003/05/17 16:32:17  knoaman
+ * Memory manager implementation : transcoder update.
+ *
  * Revision 1.7  2003/05/15 18:47:03  knoaman
  * Partial implementation of the configurable memory manager.
  *
@@ -200,6 +203,7 @@ public :
         const   XMLCh* const        encodingName
         ,       UConverter* const   toAdopt
         , const unsigned int        blockSize
+        , MemoryManager* const      manager = XMLPlatformUtils::fgMemoryManager
     );
     ~ICUTranscoder();
 
diff --git a/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp b/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp
index 07828f185666b0c69db16a3b0175bcb4f113a196..e1fec028ad32888d4b2fb6cb7f13f0769f10cd7e 100644
--- a/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp
+++ b/src/xercesc/util/Transcoders/Iconv/IconvTransService.cpp
@@ -283,7 +283,11 @@ unsigned int IconvLCPTranscoder::calcRequiredSize(const XMLCh* const srcText)
     wchar_t*      wideCharBuf = 0;
 
     if (wLent >= gTempBuffArraySize)
-        wideCharBuf = allocatedArray = new wchar_t[wLent + 1];
+        wideCharBuf = allocatedArray = (wchar_t*)
+            XMLPlatformUtils::fgMemoryManager->allocate
+            (
+                (wLent + 1) * sizeof(wchar_t)
+            );//new wchar_t[wLent + 1];
     else
         wideCharBuf = tmpWideCharArr;
 
@@ -294,7 +298,7 @@ unsigned int IconvLCPTranscoder::calcRequiredSize(const XMLCh* const srcText)
     wideCharBuf[wLent] = 0x00;
 
     const unsigned int retVal = ::wcstombs(NULL, wideCharBuf, 0);
-    delete [] allocatedArray;
+    XMLPlatformUtils::fgMemoryManager->deallocate(allocatedArray);//delete [] allocatedArray;
 
     if (retVal == ~0)
         return 0;
@@ -429,8 +433,13 @@ bool IconvLCPTranscoder::transcode( const   XMLCh* const    toTranscode
         wLent = maxBytes;
     }
 
-    if (maxBytes >= gTempBuffArraySize)
-        wideCharBuf = allocatedArray = new wchar_t[maxBytes + 1];
+    if (maxBytes >= gTempBuffArraySize) {
+        wideCharBuf = allocatedArray = (wchar_t*)
+            XMLPlatformUtils::fgMemoryManager->allocate
+            (
+                (maxBytes + 1) * sizeof(wchar_t)
+            );//new wchar_t[maxBytes + 1];
+    }
     else
         wideCharBuf = tmpWideCharArr;
 
@@ -444,13 +453,13 @@ bool IconvLCPTranscoder::transcode( const   XMLCh* const    toTranscode
     size_t mblen = ::wcstombs(toFill, wideCharBuf, maxBytes);
     if (mblen == -1)
     {
-        delete [] allocatedArray;
+        XMLPlatformUtils::fgMemoryManager->deallocate(allocatedArray);//delete [] allocatedArray;
         return false;
     }
 
     // Cap it off just in case
     toFill[mblen] = 0;
-    delete [] allocatedArray;
+    XMLPlatformUtils::fgMemoryManager->deallocate(allocatedArray);//delete [] allocatedArray;
     return true;
 }
 
@@ -572,13 +581,16 @@ bool IconvLCPTranscoder::transcode( const   char* const     toTranscode
     }
 
     if (maxChars >= gTempBuffArraySize)
-        wideCharBuf = allocatedArray = new wchar_t[maxChars + 1];
+        wideCharBuf = allocatedArray = (wchar_t*) XMLPlatformUtils::fgMemoryManager->allocate
+        (
+            (maxChars + 1) * sizeof(wchar_t)
+        );//new wchar_t[maxChars + 1];
     else
         wideCharBuf = tmpWideCharArr;
 
     if (::mbstowcs(wideCharBuf, toTranscode, maxChars) == -1)
     {
-        delete [] allocatedArray;
+        XMLPlatformUtils::fgMemoryManager->deallocate(allocatedArray);//delete [] allocatedArray;
         return false;
     }
 
@@ -587,7 +599,7 @@ bool IconvLCPTranscoder::transcode( const   char* const     toTranscode
         toFill[i] = (XMLCh) wideCharBuf[i];
     }
     toFill[len] = 0x00;
-    delete [] allocatedArray;
+    XMLPlatformUtils::fgMemoryManager->deallocate(allocatedArray);//delete [] allocatedArray;
     return true;
 }
 
diff --git a/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.cpp b/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.cpp
index 5ee01923afef319273eccb931dbc733b86379712..3a02d0870b048b2f67bb59d9e0958f0bb67309a7 100644
--- a/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.cpp
+++ b/src/xercesc/util/Transcoders/Iconv390/Iconv390TransService.cpp
@@ -378,7 +378,10 @@ unsigned int Iconv390LCPTranscoder::calcRequiredSize(const XMLCh* const srcText)
     wchar_t*      wideCharBuf = 0;
 
     if (wLent >= gTempBuffArraySize)
-        wideCharBuf = allocatedArray = new wchar_t[wLent + 1];
+        wideCharBuf = allocatedArray = (wchar_t*) XMLPlatformUtils::fgMemoryManager->allocate
+        (
+            (wLent + 1) * sizeof(wLent + 1)
+        );//new wchar_t[wLent + 1];
     else
         wideCharBuf = tmpWideCharArr;
 
@@ -389,7 +392,7 @@ unsigned int Iconv390LCPTranscoder::calcRequiredSize(const XMLCh* const srcText)
     wideCharBuf[wLent] = 0x00;
 
     const unsigned int retVal = ::wcstombs(NULL, wideCharBuf, 0);
-    delete [] allocatedArray;
+    XMLPlatformUtils::fgMemoryManager->deallocate(allocatedArray);//delete [] allocatedArray;
 
     if (retVal == -1)
         return 0;
@@ -568,11 +571,11 @@ XMLCh* Iconv390LCPTranscoder::transcode(const char* const toTranscode,
          retCode = iconv(converter->fIconv390Descriptor, &tmpInPtr, &inByteLeft, &tmpOutPtr, &outByteLeft);
         }
         if (retCode == -1) {
-            delete [] retVal;
+            manager->deallocate(retVal);//delete [] retVal;
             return 0;
         }
         retVal[len] = 0x00;
-        delete [] allocatedArray;
+        manager->deallocate(allocatedArray);//delete [] allocatedArray;
     }
     else
     {
diff --git a/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.cpp b/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.cpp
index c5c2f85bb7e0fed69d8754ad5bf0ff4379e71e9a..b574105082af47f3f387c22e4906c699cddb5f23 100644
--- a/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.cpp
+++ b/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.cpp
@@ -84,13 +84,16 @@ XERCES_CPP_NAMESPACE_BEGIN
 //  When XMLCh and ICU's UChar are not the same size, we have to do a temp
 //  conversion of all strings. These local helper methods make that easier.
 //
-static UChar* convertToUChar(   const   XMLCh* const    toConvert
-                                , const unsigned int    srcLen = 0)
+static UChar* convertToUChar( const   XMLCh* const toConvert
+                            , const unsigned int   srcLen = 0)
 {
     const unsigned int actualLen = srcLen
                                    ? srcLen : XMLString::stringLen(toConvert);
 
-    UChar* tmpBuf = new UChar[srcLen + 1];
+    UChar* tmpBuf = (UChar*) XMLPlatformUtils::fgMemoryManager->allocate
+    (
+        (srcLen + 1) * sizeof(UChar)
+    );//new UChar[srcLen + 1];
     const XMLCh* srcPtr = toConvert;
     UChar* outPtr = tmpBuf;
     while (*srcPtr)
@@ -326,7 +329,7 @@ Iconv400TransService::makeNewXMLTranscoder(  const   XMLCh* const            enc
         resValue = XMLTransService::UnsupportedEncoding;
         return 0;
     }
-    return new (manager) Iconv400Transcoder(encodingName, converter, blockSize);
+    return new (manager) Iconv400Transcoder(encodingName, converter, blockSize, manager);
 }
 
 
@@ -335,18 +338,19 @@ Iconv400TransService::makeNewXMLTranscoder(  const   XMLCh* const            enc
 // ---------------------------------------------------------------------------
 //  IconvTranscoder: Constructors and Destructor
 // ---------------------------------------------------------------------------
-Iconv400Transcoder::Iconv400Transcoder(const  XMLCh* const        encodingName
-                            ,       UConverter* const   toAdopt
-                            , const unsigned int        blockSize) :
+Iconv400Transcoder::Iconv400Transcoder( const XMLCh* const         encodingName
+                                      ,       UConverter* const    toAdopt
+                                      , const unsigned int         blockSize
+                                      ,       MemoryManager* const manager) :
 
-    XMLTranscoder(encodingName, blockSize)
+    XMLTranscoder(encodingName, blockSize, manager)
     , fConverter(toAdopt)
     , fFixed(false)
     , fSrcOffsets(0)
 {
     // If there is a block size, then allocate our source offset array
     if (blockSize)
-        fSrcOffsets = new long[blockSize];
+        fSrcOffsets = (long*) manager->allocate(blockSize * sizeof(long));//new long[blockSize];
 
     // Remember if its a fixed size encoding
     fFixed = (ucnv_getMaxCharSize(fConverter) == ucnv_getMinCharSize(fConverter));
@@ -354,7 +358,7 @@ Iconv400Transcoder::Iconv400Transcoder(const  XMLCh* const        encodingName
 
 Iconv400Transcoder::~Iconv400Transcoder()
 {
-    delete [] fSrcOffsets;
+    getMemoryManager()->deallocate(fSrcOffsets);//delete [] fSrcOffsets;
 
     // If there is a converter, ask Iconv400 to clean it up
     if (fConverter)
@@ -392,7 +396,10 @@ Iconv400Transcoder::transcodeFrom(const  XMLByte* const          srcData
     if (sizeof(XMLCh) == sizeof(UChar))
         startTarget = (UChar*)toFill;
      else
-        startTarget = new UChar[maxChars];
+        startTarget = (UChar*) getMemoryManager()->allocate
+        (
+            maxChars * sizeof(UChar)
+        );//new UChar[maxChars];
     UChar* orgTarget = startTarget;
 
     //
@@ -416,7 +423,7 @@ Iconv400Transcoder::transcodeFrom(const  XMLByte* const          srcData
     if ((err != U_ZERO_ERROR) && (err != U_INDEX_OUTOFBOUNDS_ERROR))
     {
         if (orgTarget != (UChar*)toFill)
-            delete [] orgTarget;
+            getMemoryManager()->deallocate(orgTarget);//delete [] orgTarget;
 
         if (fFixed)
         {
@@ -494,7 +501,7 @@ Iconv400Transcoder::transcodeFrom(const  XMLByte* const          srcData
             *outPtr++ = XMLCh(*startTarget++);
 
         // And delete the temp buffer
-        delete [] orgTarget;
+        getMemoryManager()->deallocate(orgTarget);//delete [] orgTarget;
     }
 
     // Return the chars we put into the target buffer
@@ -526,7 +533,7 @@ Iconv400Transcoder::transcodeTo( const   XMLCh* const    srcData
         tmpBufPtr = convertToUChar(srcData, srcCount);
         srcPtr = tmpBufPtr;
     }
-    ArrayJanitor<UChar> janTmpBuf(tmpBufPtr);
+    ArrayJanitor<UChar> janTmpBuf(tmpBufPtr, XMLPlatformUtils::fgMemoryManager);
 
     //
     //  Set the appropriate callback so that it will either fail or use
diff --git a/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.hpp b/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.hpp
index 3814c89f789d15fb388bc2da213799857fa55b78..eb33d127db1d11ca3fed9b3d24e3b3f799ab2536 100644
--- a/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.hpp
+++ b/src/xercesc/util/Transcoders/Iconv400/Iconv400TransService.hpp
@@ -151,9 +151,10 @@ public :
     // -----------------------------------------------------------------------
     Iconv400Transcoder
     (
-        const   XMLCh* const        encodingName
-        ,       UConverter* const   toAdopt
-        , const unsigned int        blockSize
+        const   XMLCh* const      encodingName
+        ,       UConverter* const toAdopt
+        , const unsigned int      blockSize
+        , MemoryManager* const    manager = XMLPlatformUtils::fgMemoryManager
     );
     ~Iconv400Transcoder();
 
diff --git a/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.cpp b/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.cpp
index 1ab965b0c0df3c7447e07b3c75d89bcb8093b107..2d55b1359e0c0cef46b88a32e873d17e380d786f 100644
--- a/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.cpp
+++ b/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.14  2003/05/17 16:32:17  knoaman
+ * Memory manager implementation : transcoder update.
+ *
  * Revision 1.13  2003/05/16 21:37:00  knoaman
  * Memory manager implementation: Modify constructors to pass in the memory manager.
  *
@@ -890,7 +893,8 @@ IconvFBSDTransService::makeNewXMLTranscoder
         newTranscoder = new (manager) IconvFBSDTranscoder (encodingName,
                              blockSize,
                              cd_from, cd_to,
-                             uChSize(), UBO());
+                             uChSize(), UBO(),
+                             manager);
     }
     if (newTranscoder)
         resValue = XMLTransService::Ok;
@@ -990,7 +994,10 @@ IconvFBSDLCPTranscoder::calcRequiredSize(const XMLCh* const srcText)
     wchar_t*      wideCharBuf = 0;
 
     if (wLent >= gTempBuffArraySize)
-        wideCharBuf = allocatedArray = new wchar_t[wLent + 1];
+        wideCharBuf = allocatedArray = (wchar_t*) XMLPlatformUtils::fgMemoryManager->allocate
+        (
+            (wLent + 1) * sizeof(wchar_t)
+        );//new wchar_t[wLent + 1];
     else
         wideCharBuf = tmpWideCharArr;
 
@@ -1001,7 +1008,7 @@ IconvFBSDLCPTranscoder::calcRequiredSize(const XMLCh* const srcText)
     const unsigned int retVal = fbsd_wcstombs(NULL, wideCharBuf, 0);
 
     if (allocatedArray)
-    delete [] allocatedArray;
+        XMLPlatformUtils::fgMemoryManager->deallocate(allocatedArray);//delete [] allocatedArray;
     if (retVal == ~0)
         return 0;
     return retVal;
@@ -1014,7 +1021,10 @@ IconvFBSDLCPTranscoder::calcRequiredSize(const XMLCh* const srcText)
     size_t      len = wLent * uChSize();
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
         if (len > gTempBuffArraySize) {
-            wBufPtr = new char[len];
+            wBufPtr = (char*) XMLPlatformUtils::fgMemoryManager->allocate
+            (
+                len * sizeof(char)
+            );//new char[len];
             if (wBufPtr == NULL)
             return 0;
             wBuf = wBufPtr;
@@ -1034,7 +1044,7 @@ IconvFBSDLCPTranscoder::calcRequiredSize(const XMLCh* const srcText)
         size_t    rc = iconvTo(ptr, &len, &pTmpArr, gTempBuffArraySize);
         if (rc == (size_t) -1 && errno != E2BIG) {
             if (wBufPtr)
-            delete [] wBufPtr;
+            XMLPlatformUtils::fgMemoryManager->deallocate(wBufPtr);//delete [] wBufPtr;
             ThrowXML(TranscodingException, XMLExcepts::Trans_BadSrcSeq);
             /* return 0; */
         }
@@ -1044,7 +1054,7 @@ IconvFBSDLCPTranscoder::calcRequiredSize(const XMLCh* const srcText)
             break;
     }
     if (wBufPtr)
-    delete [] wBufPtr;
+    XMLPlatformUtils::fgMemoryManager->deallocate(wBufPtr);//delete [] wBufPtr;
     return totalLen;
 
 #endif /* !XML_USE_LIBICONV */
@@ -1159,7 +1169,10 @@ char* IconvFBSDLCPTranscoder::transcode(const XMLCh* const toTranscode,
         wchar_t*      wideCharBuf = 0;
 
         if (wLent >= gTempBuffArraySize)
-            wideCharBuf = allocatedArray = new wchar_t[wLent + 1];
+            wideCharBuf = allocatedArray = (wchar_t*) manager->allocate
+            (
+                (wLent + 1) * sizeof(wchar_t)
+            );//new wchar_t[wLent + 1];
         else
             wideCharBuf = tmpWideCharArr;
 
@@ -1171,14 +1184,14 @@ char* IconvFBSDLCPTranscoder::transcode(const XMLCh* const toTranscode,
         const size_t neededLen = fbsd_wcstombs(NULL, wideCharBuf, 0);
         if (neededLen == -1) {
             if (allocatedArray)
-                delete [] allocatedArray;
+                manager->deallocate(allocatedArray);//delete [] allocatedArray;
             return 0;
         }
 
-        retVal = new char[neededLen + 1];
+        retVal = (char*) manager->allocate((neededLen + 1) * sizeof(char));//new char[neededLen + 1];
         fbsd_wcstombs(retVal, wideCharBuf, neededLen);
         if (allocatedArray)
-            delete [] allocatedArray;
+            manager->deallocate(allocatedArray);//delete [] allocatedArray;
         retVal[neededLen] = 0;
 
 #else /* XML_USE_LIBICONV */
@@ -1188,7 +1201,7 @@ char* IconvFBSDLCPTranscoder::transcode(const XMLCh* const toTranscode,
         if (neededLen == 0)
             return 0;
         // allocate output buffer
-        retVal = new char[neededLen + 1];
+        retVal = (char*) manager->allocate((neededLen + 1) * sizeof(char));//new char[neededLen + 1];
         if (retVal == NULL)
             return 0;
         // prepare the original
@@ -1199,9 +1212,11 @@ char* IconvFBSDLCPTranscoder::transcode(const XMLCh* const toTranscode,
 
         if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
             if (len > gTempBuffArraySize) {
-            wBufPtr = new char[len];
-            if (wBufPtr == NULL)
+            wBufPtr = (char*) manager->allocate(len * sizeof(char));//new char[len];
+            if (wBufPtr == NULL) {
+                manager->deallocate(retVal);
                 return 0;
+            }
             wideCharBuf = wBufPtr;
             } else
             wideCharBuf = tmpWBuff;
@@ -1216,17 +1231,17 @@ char* IconvFBSDLCPTranscoder::transcode(const XMLCh* const toTranscode,
         size_t  rc = iconvTo(wideCharBuf, &tmpwLent, &ptr, neededLen);
         if (rc == (size_t)-1) {
             if (wBufPtr)
-            delete [] wBufPtr;
+                manager->deallocate(wBufPtr);//delete [] wBufPtr;
             return 0;
         }
         if (wBufPtr)
-            delete [] wBufPtr;
+            manager->deallocate(wBufPtr);//delete [] wBufPtr;
         retVal[neededLen] = 0;
 
 #endif /* !XML_USE_LIBICONV */
 
     } else {
-        retVal = new char[1];
+        retVal = (char*) manager->allocate(sizeof(char));//new char[1];
         if (retVal == NULL)
             return 0;
         retVal[0] = 0;
@@ -1262,7 +1277,10 @@ bool IconvFBSDLCPTranscoder::transcode( const   XMLCh* const    toTranscode
     wchar_t*      wideCharBuf = 0;
 
     if (maxBytes >= gTempBuffArraySize)
-        wideCharBuf = allocatedArray = new wchar_t[maxBytes + 1];
+        wideCharBuf = allocatedArray = (wchar_t*) XMLPlatformUtils::fgMemoryManager->allocate
+        (
+            (maxBytes + 1) * sizeof(wchar_t)
+        );//new wchar_t[maxBytes + 1];
     else
         wideCharBuf = tmpWideCharArr;
 
@@ -1274,11 +1292,11 @@ bool IconvFBSDLCPTranscoder::transcode( const   XMLCh* const    toTranscode
     mblen = fbsd_wcstombs(toFill, wideCharBuf, maxBytes);
     if (mblen == -1) {
         if (allocatedArray)
-            delete [] allocatedArray;
+            XMLPlatformUtils::fgMemoryManager->deallocate(allocatedArray);//delete [] allocatedArray;
         return false;
     }
     if (allocatedArray)
-        delete [] allocatedArray;
+        XMLPlatformUtils::fgMemoryManager->deallocate(allocatedArray);//delete [] allocatedArray;
 
 #else /* XML_USE_LIBICONV */
 
@@ -1290,10 +1308,13 @@ bool IconvFBSDLCPTranscoder::transcode( const   XMLCh* const    toTranscode
 
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
         if (len > gTempBuffArraySize) {
-             wBufPtr = new char[len];
-             if (wBufPtr == NULL)
-                 return 0;
-             wideCharBuf = wBufPtr;
+            wBufPtr = (char*) XMLPlatformUtils::fgMemoryManager->allocate
+            (
+                len * sizeof(char)
+            );//new char[len];
+            if (wBufPtr == NULL)
+                return 0;
+            wideCharBuf = wBufPtr;
          }
          else
              wideCharBuf = tmpWBuff;
@@ -1307,11 +1328,11 @@ bool IconvFBSDLCPTranscoder::transcode( const   XMLCh* const    toTranscode
     mblen = iconvTo(wideCharBuf, &len, &ptr, maxBytes);
     if (mblen == (size_t)-1) {
         if (wBufPtr)
-            delete [] wBufPtr;
+           XMLPlatformUtils::fgMemoryManager->deallocate(wBufPtr);//delete [] wBufPtr;
         return false;
     }
     if (wBufPtr)
-        delete [] wBufPtr;
+        XMLPlatformUtils::fgMemoryManager->deallocate(wBufPtr);//delete [] wBufPtr;
 
 #endif /* !XML_USE_LIBICONV */
 
@@ -1417,7 +1438,7 @@ XMLCh* IconvFBSDLCPTranscoder::transcode(const char* const toTranscode,
     if (*toTranscode) {
         const unsigned int wLent = calcRequiredSize(toTranscode);
         if (wLent == 0) {
-            retVal = new XMLCh[1];
+            retVal = (XMLCh*) manager->allocate(sizeof(XMLCh));//new XMLCh[1];
             retVal[0] = 0;
             return retVal;
         }
@@ -1429,22 +1450,25 @@ XMLCh* IconvFBSDLCPTranscoder::transcode(const char* const toTranscode,
         wchar_t*      wideCharBuf = 0;
 
         if (wLent >= gTempBuffArraySize)
-            wideCharBuf = allocatedArray = new wchar_t[wLent + 1];
+            wideCharBuf = allocatedArray = (wchar_t*) manager->allocate
+            (
+                (wLent + 1) * sizeof(wchar_t)
+            );//new wchar_t[wLent + 1];
         else
             wideCharBuf = tmpWideCharArr;
 
         fbsd_mbstowcs(wideCharBuf, toTranscode, wLent);
-        retVal = new XMLCh[wLent + 1];
+        retVal = (XMLCh*) manager->allocate((wLent + 1) * sizeof(XMLCh));//new XMLCh[wLent + 1];
         if (retVal == NULL) {
             if (allocatedArray)
-                delete [] allocatedArray;
+                manager->deallocate(allocatedArray);//delete [] allocatedArray;
             return NULL;
         }
         for (unsigned int i = 0; i < wLent; i++)
             retVal[i] = (XMLCh) wideCharBuf[i];
         retVal[wLent] = 0x00;
         if (allocatedArray)
-            delete [] allocatedArray;
+            manager->deallocate(allocatedArray);//delete [] allocatedArray;
 
 #else /* XML_USE_LIBICONV */
 
@@ -1453,12 +1477,12 @@ XMLCh* IconvFBSDLCPTranscoder::transcode(const char* const toTranscode,
         char    *wBufPtr = 0;
         size_t  len = wLent * uChSize();
 
-        retVal = new XMLCh[wLent + 1];
+        retVal = (XMLCh*) manager->allocate((wLent + 1) * sizeof(XMLCh));//new XMLCh[wLent + 1];
         if (retVal == NULL)
             return NULL;
         if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
             if (len > gTempBuffArraySize) {
-                wBufPtr = new char[len];
+                wBufPtr = (char*) manager->allocate(len * sizeof(char));//new char[len];
                 if (wBufPtr == NULL)
                     return 0;
                 wideCharBuf = wBufPtr;
@@ -1472,20 +1496,20 @@ XMLCh* IconvFBSDLCPTranscoder::transcode(const char* const toTranscode,
         size_t    rc = iconvFrom(toTranscode, &flen, &ptr, len);
         if (rc == (size_t) -1) {
             if (wBufPtr)
-            delete [] wBufPtr;
+            manager->deallocate(wBufPtr);//delete [] wBufPtr;
             return NULL;
         }
         if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER)
             mbsToXML (wideCharBuf, wLent, retVal, wLent);
         if (wBufPtr)
-            delete [] wBufPtr;
+            manager->deallocate(wBufPtr);//delete [] wBufPtr;
         retVal[wLent] = 0x00;
 
 #endif /* !XML_USE_LIBICONV */
 
     }
     else {
-        retVal = new XMLCh[1];
+        retVal = (XMLCh*) manager->allocate(sizeof(XMLCh));//new XMLCh[1];
         if (retVal == NULL )
             return 0;
         retVal[0] = 0;
@@ -1522,19 +1546,22 @@ bool IconvFBSDLCPTranscoder::transcode(const   char* const    toTranscode
     wchar_t*      wideCharBuf = 0;
 
     if (maxChars >= gTempBuffArraySize)
-        wideCharBuf = allocatedArray = new wchar_t[wLent + 1];
+        wideCharBuf = allocatedArray = (wchar_t*) XMLPlatformUtils::fgMemoryManager->allocate
+        (
+            (wLent + 1) * sizeof(wchar_t)
+        );//new wchar_t[wLent + 1];
     else
         wideCharBuf = tmpWideCharArr;
 
     if (fbsd_mbstowcs(wideCharBuf, toTranscode, wLent) == -1) {
         if (allocatedArray)
-            delete [] allocatedArray;
+            XMLPlatformUtils::fgMemoryManager->deallocate(allocatedArray);//delete [] allocatedArray;
         return false;
     }
     for (unsigned int i = 0; i < wLent; i++)
         toFill[i] = (XMLCh) wideCharBuf[i];
     if (allocatedArray)
-    delete [] allocatedArray;
+    XMLPlatformUtils::fgMemoryManager->deallocate(allocatedArray);//delete [] allocatedArray;
 
 #else /* XML_USE_LIBICONV */
 
@@ -1545,7 +1572,10 @@ bool IconvFBSDLCPTranscoder::transcode(const   char* const    toTranscode
 
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
     if (len > gTempBuffArraySize) {
-        wBufPtr = new char[len];
+        wBufPtr = (char*) XMLPlatformUtils::fgMemoryManager->allocate
+        (
+            len * sizeof(char)
+        );//new char[len];
         if (wBufPtr == NULL)
         return 0;
         wideCharBuf = wBufPtr;
@@ -1559,14 +1589,14 @@ bool IconvFBSDLCPTranscoder::transcode(const   char* const    toTranscode
     size_t    rc = iconvFrom(toTranscode, &flen, &ptr, len);
     if (rc == (size_t)-1) {
         if (wBufPtr)
-            delete [] wBufPtr;
+            XMLPlatformUtils::fgMemoryManager->deallocate(wBufPtr);//delete [] wBufPtr;
         return false;
     }
 
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER)
     mbsToXML (wideCharBuf, wLent, toFill, wLent);
     if (wBufPtr)
-        delete [] wBufPtr;
+        XMLPlatformUtils::fgMemoryManager->deallocate(wBufPtr);//delete [] wBufPtr;
 
 #endif /* !XML_USE_LIBICONV */
 
@@ -1616,8 +1646,9 @@ IconvFBSDTranscoder::IconvFBSDTranscoder (const    XMLCh* const    encodingName
                       ,    iconv_t        cd_to
                       ,    size_t        uchsize
                       ,    unsigned int    ubo
+                      , MemoryManager* const manager
     )
-    : XMLTranscoder(encodingName, blockSize)
+    : XMLTranscoder(encodingName, blockSize, manager)
     , IconvFBSDCD (cd_from, cd_to, uchsize, ubo)
 {
 }
@@ -1658,7 +1689,10 @@ unsigned int    IconvFBSDTranscoder::transcodeFrom
 
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
         if (len > gTempBuffArraySize) {
-            wBufPtr = new char[len];
+            wBufPtr = (char*) getMemoryManager()->allocate
+            (
+                len * sizeof(char)
+            );//new char[len];
             if (wBufPtr == NULL)
             return 0;
             startTarget = wBufPtr;
@@ -1678,7 +1712,7 @@ unsigned int    IconvFBSDTranscoder::transcodeFrom
         if (rc == (size_t)-1) {
             if (errno != E2BIG || prevSrcLen == srcLen) {
                 if (wBufPtr)
-                    delete [] wBufPtr;
+                    getMemoryManager()->deallocate(wBufPtr);//delete [] wBufPtr;
                 ThrowXML(TranscodingException, XMLExcepts::Trans_BadSrcSeq);
             }
         }
@@ -1691,7 +1725,7 @@ unsigned int    IconvFBSDTranscoder::transcodeFrom
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER)
         mbsToXML (startTarget, toReturn, toFill, toReturn);
     if (wBufPtr)
-        delete [] wBufPtr;
+        getMemoryManager()->deallocate(wBufPtr);//delete [] wBufPtr;
     return toReturn;
 }
 
@@ -1712,7 +1746,10 @@ unsigned int    IconvFBSDTranscoder::transcodeTo
 
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
         if (len > gTempBuffArraySize) {
-            wBufPtr = new char[len];
+            wBufPtr = (char*) getMemoryManager()->allocate
+            (
+                len * sizeof(char)
+            );//new char[len];
             if (wBufPtr == NULL)
                 return 0;
             startSrc = wBufPtr;
@@ -1727,12 +1764,12 @@ unsigned int    IconvFBSDTranscoder::transcodeTo
     size_t    rc = iconvTo (startSrc, &srcLen, &startTarget, maxBytes);
     if (rc == (size_t)-1 && errno != E2BIG) {
         if (wBufPtr)
-            delete [] wBufPtr;
+            getMemoryManager()->deallocate(wBufPtr);//delete [] wBufPtr;
         ThrowXML(TranscodingException, XMLExcepts::Trans_BadSrcSeq);
     }
     charsEaten = srcCount - srcLen / uChSize();
     if (wBufPtr)
-        delete [] wBufPtr;
+        getMemoryManager()->deallocate(wBufPtr);//delete [] wBufPtr;
     return startTarget - (char *)toFill;
 }
 
diff --git a/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.hpp b/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.hpp
index 27183fbbfaa296333f3cbfa46ee42330cb350f3a..f33c4c7bfa9b78d9108806ea43d912798f8d4042 100644
--- a/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.hpp
+++ b/src/xercesc/util/Transcoders/IconvFBSD/IconvFBSDTransService.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.8  2003/05/17 16:32:18  knoaman
+ * Memory manager implementation : transcoder update.
+ *
  * Revision 1.7  2003/05/15 18:47:04  knoaman
  * Partial implementation of the configurable memory manager.
  *
@@ -316,6 +319,7 @@ public :
 			,	iconv_t		cd_to
 			,	size_t		uchsize
 			,	unsigned int	ubo
+			, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     );
     ~IconvFBSDTranscoder();
 
diff --git a/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp b/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp
index d7f3925a8103660d40f9193a6e226232c1edfdfb..6792bb59bef12a43250c36fb96b497b2864c69e3 100644
--- a/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp
+++ b/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.cpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.9  2003/05/17 16:32:18  knoaman
+ * Memory manager implementation : transcoder update.
+ *
  * Revision 1.8  2003/05/16 21:37:00  knoaman
  * Memory manager implementation: Modify constructors to pass in the memory manager.
  *
@@ -693,7 +696,7 @@ IconvGNUTransService::makeNewXMLTranscoder
         newTranscoder = new (manager) IconvGNUTranscoder (encodingName,
                              blockSize,
                              cd_from, cd_to,
-                             uChSize(), UBO());
+                             uChSize(), UBO(), manager);
     }
     if (newTranscoder)
         resValue = XMLTransService::Ok;
@@ -771,7 +774,10 @@ IconvGNULCPTranscoder::calcRequiredSize(const XMLCh* const srcText)
     size_t      len = wLent * uChSize();
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
         if (len > gTempBuffArraySize) {
-            wBufPtr = new char[len];
+            wBufPtr = (char*) XMLPlatformUtils::fgMemoryManager->allocate
+            (
+                len * sizeof(char)
+            );//new char[len];
             if (wBufPtr == NULL)
             return 0;
             wBuf = wBufPtr;
@@ -791,7 +797,7 @@ IconvGNULCPTranscoder::calcRequiredSize(const XMLCh* const srcText)
         size_t    rc = iconvTo(ptr, &len, &pTmpArr, gTempBuffArraySize);
         if (rc == (size_t) -1 && errno != E2BIG) {
             if (wBufPtr)
-                delete [] wBufPtr;
+                XMLPlatformUtils::fgMemoryManager->deallocate(wBufPtr);//delete [] wBufPtr;
             ThrowXML(TranscodingException, XMLExcepts::Trans_BadSrcSeq);
             /* return 0; */
         }
@@ -801,7 +807,7 @@ IconvGNULCPTranscoder::calcRequiredSize(const XMLCh* const srcText)
             break;
     }
     if (wBufPtr)
-        delete [] wBufPtr;
+        XMLPlatformUtils::fgMemoryManager->deallocate(wBufPtr);//delete [] wBufPtr;
     return totalLen;
 }
 
@@ -878,7 +884,7 @@ char* IconvGNULCPTranscoder::transcode(const XMLCh* const toTranscode,
         if (neededLen == 0)
             return 0;
         // allocate output buffer
-        retVal = new char[neededLen + 1];
+        retVal = (char*) manager->allocate((neededLen + 1) * sizeof(char));//new char[neededLen + 1];
         if (retVal == NULL)
             return 0;
         // prepare the original
@@ -889,7 +895,7 @@ char* IconvGNULCPTranscoder::transcode(const XMLCh* const toTranscode,
 
         if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
             if (len > gTempBuffArraySize) {
-                wBufPtr = new char[len];
+                wBufPtr = (char*) manager->allocate(len * sizeof(char));//new char[len];
                 if (wBufPtr == NULL)
                     return 0;
                 wideCharBuf = wBufPtr;
@@ -905,15 +911,15 @@ char* IconvGNULCPTranscoder::transcode(const XMLCh* const toTranscode,
         size_t    rc = iconvTo(wideCharBuf, (size_t *) &wLent, &ptr, neededLen);
         if (rc == (size_t)-1) {
             if (wBufPtr)
-            delete [] wBufPtr;
+            manager->deallocate(wBufPtr);//delete [] wBufPtr;
             return 0;
         }
         if (wBufPtr)
-            delete [] wBufPtr;
+            manager->deallocate(wBufPtr);//delete [] wBufPtr;
         retVal[neededLen] = 0;
 
     } else {
-        retVal = new char[1];
+        retVal = (char*) manager->allocate(sizeof(char));//new char[1];
         if (retVal == NULL)
             return 0;
         retVal[0] = 0;
@@ -948,7 +954,10 @@ bool IconvGNULCPTranscoder::transcode( const   XMLCh* const    toTranscode
 
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
         if (len > gTempBuffArraySize) {
-            wBufPtr = new char[len];
+            wBufPtr = (char*) XMLPlatformUtils::fgMemoryManager->allocate
+            (
+                len * sizeof(char)
+            );//new char[len];
             if (wBufPtr == NULL)
                 return 0;
         wideCharBuf = wBufPtr;
@@ -963,11 +972,11 @@ bool IconvGNULCPTranscoder::transcode( const   XMLCh* const    toTranscode
     size_t    rc = iconvTo(wideCharBuf, &len, &ptr, maxBytes);
     if (rc == (size_t)-1) {
         if (wBufPtr)
-            delete [] wBufPtr;
+            XMLPlatformUtils::fgMemoryManager->deallocate(wBufPtr);//delete [] wBufPtr;
         return false;
     }
     if (wBufPtr)
-        delete [] wBufPtr;
+        XMLPlatformUtils::fgMemoryManager->deallocate(wBufPtr);//delete [] wBufPtr;
 
     // Cap it off just in case
     toFill[rc] = 0;
@@ -1042,7 +1051,7 @@ XMLCh* IconvGNULCPTranscoder::transcode(const char* const toTranscode,
     if (*toTranscode) {
         const unsigned int wLent = calcRequiredSize(toTranscode);
         if (wLent == 0) {
-            retVal = new XMLCh[1];
+            retVal = (XMLCh*) manager->allocate(sizeof(XMLCh));/new XMLCh[1];
             retVal[0] = 0;
             return retVal;
         }
@@ -1052,12 +1061,12 @@ XMLCh* IconvGNULCPTranscoder::transcode(const char* const toTranscode,
         char    *wBufPtr = 0;
         size_t  len = wLent * uChSize();
 
-        retVal = new XMLCh[wLent + 1];
+        retVal = (XMLCh*) manager->allocate((wLent + 1) * sizeof(XMLCh));//new XMLCh[wLent + 1];
         if (retVal == NULL)
             return NULL;
         if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
             if (len > gTempBuffArraySize) {
-                wBufPtr = new char[len];
+                wBufPtr = (char*) manager->allocate(len * sizeof(char));//new char[len];
                 if (wBufPtr == NULL)
                     return 0;
                 wideCharBuf = wBufPtr;
@@ -1071,17 +1080,17 @@ XMLCh* IconvGNULCPTranscoder::transcode(const char* const toTranscode,
         size_t    rc = iconvFrom(toTranscode, &flen, &ptr, len);
         if (rc == (size_t) -1) {
             if (wBufPtr)
-            delete [] wBufPtr;
+            manager->deallocate(wBufPtr);//delete [] wBufPtr;
             return NULL;
         }
         if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER)
             mbsToXML (wideCharBuf, wLent, retVal, wLent);
         if (wBufPtr)
-            delete [] wBufPtr;
+            manager->deallocate(wBufPtr);//delete [] wBufPtr;
         retVal[wLent] = 0x00;
     }
     else {
-        retVal = new XMLCh[1];
+        retVal = (XMLCh*) manager->allocate(sizeof(XMLCh));//new XMLCh[1];
         if (retVal == NULL )
             return 0;
         retVal[0] = 0;
@@ -1118,7 +1127,10 @@ bool IconvGNULCPTranscoder::transcode(const   char* const    toTranscode
 
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
         if (len > gTempBuffArraySize) {
-            wBufPtr = new char[len];
+            wBufPtr = (char*) XMLPlatformUtils::fgMemoryManager->allocate
+            (
+                len * sizeof(char)
+            );//new char[len];
             if (wBufPtr == NULL)
                 return 0;
             wideCharBuf = wBufPtr;
@@ -1132,14 +1144,14 @@ bool IconvGNULCPTranscoder::transcode(const   char* const    toTranscode
     size_t    rc = iconvFrom(toTranscode, &flen, &ptr, len);
     if (rc == (size_t)-1) {
         if (wBufPtr)
-            delete [] wBufPtr;
+            XMLPlatformUtils::fgMemoryManager->deallocate(wBufPtr);//delete [] wBufPtr;
         return false;
     }
 
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER)
         mbsToXML (wideCharBuf, wLent, toFill, wLent);
     if (wBufPtr)
-        delete [] wBufPtr;
+        XMLPlatformUtils::fgMemoryManager->deallocate(wBufPtr);//delete [] wBufPtr;
 
     toFill[wLent] = 0x00;
     return true;
@@ -1174,8 +1186,9 @@ IconvGNUTranscoder::IconvGNUTranscoder (const    XMLCh* const    encodingName
                       ,    iconv_t        cd_to
                       ,    size_t        uchsize
                       ,    unsigned int    ubo
+                      , MemoryManger* const manager
     )
-    : XMLTranscoder(encodingName, blockSize)
+    : XMLTranscoder(encodingName, blockSize, manager)
     , IconvGNUWrapper (cd_from, cd_to, uchsize, ubo)
 {
 }
@@ -1216,7 +1229,10 @@ unsigned int    IconvGNUTranscoder::transcodeFrom
 
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
         if (len > gTempBuffArraySize) {
-            wBufPtr = new char[len];
+            wBufPtr = (char*) getMemoryManager()->allocate
+            (
+                len * sizeof(char)
+            );//new char[len];
             if (wBufPtr == NULL)
                 return 0;
             startTarget = wBufPtr;
@@ -1236,7 +1252,7 @@ unsigned int    IconvGNUTranscoder::transcodeFrom
         if (rc == (size_t)-1) {
             if (errno != E2BIG || prevSrcLen == srcLen) {
                 if (wBufPtr)
-                    delete [] wBufPtr;
+                    getMemoryManager()->deallocate(wBufPtr);//delete [] wBufPtr;
                 ThrowXML(TranscodingException, XMLExcepts::Trans_BadSrcSeq);
             }
         }
@@ -1249,7 +1265,7 @@ unsigned int    IconvGNUTranscoder::transcodeFrom
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER)
         mbsToXML (startTarget, toReturn, toFill, toReturn);
     if (wBufPtr)
-        delete [] wBufPtr;
+        getMemoryManager()->deallocate(wBufPtr);//delete [] wBufPtr;
     return toReturn;
 }
 
@@ -1270,7 +1286,10 @@ unsigned int    IconvGNUTranscoder::transcodeTo
 
     if (uChSize() != sizeof(XMLCh) || UBO() != BYTE_ORDER) {
         if (len > gTempBuffArraySize) {
-            wBufPtr = new char[len];
+            wBufPtr = (char*) getMemoryManager()->allocate
+            (
+                len * sizeof(char)
+            );//new char[len];
             if (wBufPtr == NULL)
                 return 0;
             startSrc = wBufPtr;
@@ -1285,12 +1304,12 @@ unsigned int    IconvGNUTranscoder::transcodeTo
     size_t    rc = iconvTo (startSrc, &srcLen, &startTarget, maxBytes);
     if (rc == (size_t)-1 && errno != E2BIG) {
         if (wBufPtr)
-            delete [] wBufPtr;
+            getMemoryManager()->deallocate(wBufPtr);//delete [] wBufPtr;
         ThrowXML(TranscodingException, XMLExcepts::Trans_BadSrcSeq);
     }
     charsEaten = srcCount - srcLen / uChSize();
     if (wBufPtr)
-        delete [] wBufPtr;
+        getMemoryManager()->deallocate(wBufPtr);//delete [] wBufPtr;
     return startTarget - (char *)toFill;
 }
 
diff --git a/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp b/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp
index 4f645068017f7ede8be889aa7d140153ea9a8484..910c2b96155d9131809c1efac6031df1f6ef08bb 100644
--- a/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp
+++ b/src/xercesc/util/Transcoders/IconvGNU/IconvGNUTransService.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.5  2003/05/17 16:32:18  knoaman
+ * Memory manager implementation : transcoder update.
+ *
  * Revision 1.4  2003/05/15 18:47:05  knoaman
  * Partial implementation of the configurable memory manager.
  *
@@ -286,6 +289,7 @@ public :
   		,	iconv_t		cd_to
   		,	size_t		uchsize
   		,	unsigned int	ubo
+        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     );
     ~IconvGNUTranscoder();
 
diff --git a/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp b/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp
index 797a2ef0088e1fd536bf7030fe9b0ce4972c20a3..2cdae31f148cbe7a759d046c6bdf0c6d2b35357b 100644
--- a/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp
+++ b/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp
@@ -579,7 +579,7 @@ MacOSUnicodeConverter::makeNewXMLTranscoder(const   XMLCh* const		encodingName
 		resValue = XMLTransService::UnsupportedEncoding;
 	}
 	else
-		result = new (manager) MacOSTranscoder(encodingName, textToUnicodeInfo, unicodeToTextInfo, blockSize);
+		result = new (manager) MacOSTranscoder(encodingName, textToUnicodeInfo, unicodeToTextInfo, blockSize, manager);
 	
     return result;
 }
@@ -603,8 +603,9 @@ MacOSUnicodeConverter::IsMacOSUnicodeConverterSupported(void)
 MacOSTranscoder::MacOSTranscoder(const  XMLCh* const encodingName
 								, TextToUnicodeInfo	 textToUnicodeInfo
 								, UnicodeToTextInfo	 unicodeToTextInfo
-                                , const unsigned int blockSize) :
-    XMLTranscoder(encodingName, blockSize),
+                                , const unsigned int blockSize
+                                , MemoryManager* const manager) :
+    XMLTranscoder(encodingName, blockSize, manager),
     mTextToUnicodeInfo(textToUnicodeInfo),
     mUnicodeToTextInfo(unicodeToTextInfo)
 {
@@ -1100,6 +1101,116 @@ MacOSLCPTranscoder::transcode(const XMLCh* const srcText)
 	return result.release();
 }
 
+char*
+MacOSLCPTranscoder::transcode(const XMLCh* const srcText,
+                              MemoryManager* const manager)
+{
+	if (!srcText)
+		return NULL;
+
+	ArrayJanitor<char> result(0);
+	const XMLCh* src		= srcText;
+	std::size_t srcCnt		= XMLString::stringLen(src);
+	std::size_t resultCnt	= 0;
+
+	OptionBits options =
+		  kUnicodeUseFallbacksMask
+		| kUnicodeLooseMappingsMask
+		// | kUnicodeKeepInfoMask
+		// | kUnicodeStringUnterminatedMask
+		;
+
+	OSStatus status;
+	for (status = noErr; status == noErr && srcCnt > 0; )
+	{
+		//	Convert an (internal) buffer full of text
+	    ByteCount		bytesConsumed = 0;
+	    ByteCount		bytesProduced = 0;
+		std::size_t		passCnt = 0;
+		const UniChar*	passSrc = NULL;
+		
+		//	Setup source buffer as needed to accomodate a unicode
+		//	character size mismatch.
+		TempUniBuf	iBuf;
+		if (UNICODE_SIZE_MISMATCH)
+		{
+			passCnt = std::min(srcCnt, kTempUniBufCount);
+			passSrc = CopyXMLChsToUniChars(src, iBuf, passCnt, kTempUniBufCount);
+		}
+		else
+		{
+			passCnt = srcCnt;
+			passSrc = reinterpret_cast<const UniChar*>(src);
+		}
+		
+		TempUniBuf oBuf;
+		
+	    status = ConvertFromUnicodeToText(
+	    	mUnicodeToTextInfo,
+	    	passCnt * sizeof(UniChar),	// src byte count
+	    	passSrc,			// source buffer
+	    	options,			// control flags
+	    	0,					// ioffset count
+	    	NULL,				// ioffset array
+	    	0,					// ooffset count
+	    	NULL,				// ooffset array
+	    	kTempUniBufCount * sizeof(UniChar),
+	    	&bytesConsumed,
+	    	&bytesProduced,
+	    	oBuf);
+			
+		//	Move the data to result buffer, reallocating as needed
+		if (bytesProduced > 0)
+		{
+			//	Allocate space for result
+			std::size_t newCnt = resultCnt + bytesProduced;
+			ArrayJanitor<char> newResult
+            (
+                (char*) manager->allocate((newCnt + 1) * sizeof(char)) //new char[newCnt + 1]
+                , manager
+            );
+			if (newResult.get() != NULL)
+			{
+				//	Incorporate previous result
+				if (result.get() != NULL)
+					std::memcpy(newResult.get(), result.get(), resultCnt);
+				result.reset(newResult.release());
+
+				//	Copy in new data
+				std::memcpy(result.get() + resultCnt, oBuf, bytesProduced);
+				resultCnt = newCnt;
+				
+				result[resultCnt] = '\0';					
+			}
+		}
+		
+		std::size_t charsConsumed = bytesConsumed / sizeof(UniChar);
+		src		+= charsConsumed;
+		srcCnt	-= charsConsumed;
+
+		if (status == kTECOutputBufferFullStatus)
+			status = noErr;
+
+		options |= kUnicodeKeepInfoMask;
+	}
+	
+	if (status != noErr && status != kTECPartialCharErr)
+		result.reset();
+	else if (!result.get())
+	{
+		//	No error, and no result: we probably processed a zero length
+		//	input, in which case we want a valid zero length output.
+		result.reset
+        (
+            (char*) manager->allocate(sizeof(char))//new char[1]
+            , manager
+        );
+		result[0] = '\0';
+	}
+	
+	return result.release();
+}
+
 
 XMLCh*
 MacOSLCPTranscoder::transcode(const char* const srcText)
@@ -1189,6 +1300,103 @@ MacOSLCPTranscoder::transcode(const char* const srcText)
 	return result.release();
 }
 
+XMLCh*
+MacOSLCPTranscoder::transcode(const char* const srcText,
+                              MemoryManager* const manager)
+{
+	if (!srcText)
+		return NULL;
+
+	ArrayJanitor<XMLCh> result(0);
+	const char* src			= srcText;
+	std::size_t srcCnt		= std::strlen(src);
+	std::size_t resultCnt	= 0;
+
+	OptionBits options =
+		  kUnicodeUseFallbacksMask
+		// | kUnicodeKeepInfoMask
+		| kUnicodeDefaultDirectionMask
+		| kUnicodeLooseMappingsMask
+		// | kUnicodeStringUnterminatedMask
+		// | kUnicodeTextRunMask
+		;
+
+	OSStatus status;
+	for (status = noErr; status == noErr && srcCnt > 0; )
+	{
+		//	Convert an (internal) buffer full of text
+	    ByteCount	bytesConsumed = 0;
+	    ByteCount	bytesProduced = 0;
+		
+		TempUniBuf buf;
+
+	    status = ConvertFromTextToUnicode(
+	    	mTextToUnicodeInfo,
+	    	srcCnt,				// src byte count
+	    	src,
+	    	options,			// control flags
+	    	0,					// ioffset count
+	    	NULL,				// ioffset array
+	    	0,					// ooffset count
+	    	NULL,				// ooffset array
+	    	kTempUniBufCount * sizeof(UniChar),	// Byte count of destination buffer
+	    	&bytesConsumed,
+	    	&bytesProduced,
+	    	buf);
+		
+		std::size_t charsProduced = bytesProduced / sizeof(UniChar);
+		
+		//	Move the data to result buffer, reallocating as needed
+		if (charsProduced > 0)
+		{
+			//	Allocate space for result
+			std::size_t newCnt = resultCnt + charsProduced;
+			ArrayJanitor<XMLCh> newResult
+            (
+                (XMLCh*) manager->allocate((newCnt + 1) * sizeof(XMLCh))//new XMLCh[newCnt + 1]
+                , manager
+            );
+			if (newResult.get() != NULL)
+			{
+				//	Incorporate previous result
+				if (result.get() != NULL)
+					std::memcpy(newResult.get(), result.get(), resultCnt * sizeof(XMLCh));
+				result.reset(newResult.release());
+
+				//	Copy in new data, converting character formats as necessary
+				CopyUniCharsToXMLChs(buf, result.get() + resultCnt, charsProduced, charsProduced);
+				resultCnt = newCnt;
+				
+				result[resultCnt] = 0;			
+			}
+		}
+
+		src		+= bytesConsumed;
+		srcCnt  -= bytesConsumed;
+
+		if (status == kTECOutputBufferFullStatus)
+			status = noErr;
+			
+		options |= kUnicodeKeepInfoMask;
+	}
+	
+	if (status != noErr && status != kTECPartialCharErr)
+		result.reset();
+	else if (!result.get())
+	{
+		//	No error, and no result: we probably processed a zero length
+		//	input, in which case we want a valid zero length output.
+		result.reset
+        (
+            (XMLCh*) manager->allocate(sizeof(XMLCh))//new XMLCh[1]
+            , manager
+        );
+		result[0] = '\0';
+	}
+	
+	return result.release();
+}
+
 
 bool
 MacOSLCPTranscoder::transcode( 		 const   char* const	toTranscode
diff --git a/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp b/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp
index 86c5c69e9cf9b8774f0700a0f1e1b5bc5011009c..cadfa98fde441e0329336e4fdabb37c9900ae2f3 100644
--- a/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp
+++ b/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.hpp
@@ -171,7 +171,8 @@ public :
 	    const XMLCh* const		encodingName,
 	    TextToUnicodeInfo		textToUnicodeInfo,
 	    UnicodeToTextInfo		unicodeToTextInfo,
-	    const unsigned int		blockSize
+	    const unsigned int		blockSize,
+	    MemoryManager* const    manager = XMLPlatformUtils::fgMemoryManager
 		);
     ~MacOSTranscoder();
 
diff --git a/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp b/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp
index 9e2a05449aab28ad5072fd2322a3993b0ed1f720..6b578f37b0b26fdfdcd6eb8b6b07cc0c78210ea6 100644
--- a/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp
+++ b/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp
@@ -500,7 +500,7 @@ DBGPRINTF3("makeNewXMLTranscoder() encoding=%s blocksize=%d\n",localname,blockSi
 
    if (gViewTranscoder)
       printf("IXM1003I XML - Using Unicode Services - %s\n",localname);
-   return new (manager) Uniconv390Transcoder(encodingName, tconv, blockSize);
+   return new (manager) Uniconv390Transcoder(encodingName, tconv, blockSize, manager);
 }
 
 
@@ -519,8 +519,9 @@ DBGPRINTF3("makeNewXMLTranscoder() encoding=%s blocksize=%d\n",localname,blockSi
 // ---------------------------------------------------------------------------
 Uniconv390Transcoder::Uniconv390Transcoder(const  XMLCh* const        encodingName
                             ,        uniconvconverter_t * const   toAdopt
-                            , const unsigned int        blockSize) :
-    XMLTranscoder(encodingName, blockSize)
+                            , const unsigned int        blockSize
+                            , MemoryManager* const manager) :
+    XMLTranscoder(encodingName, blockSize, manager)
     , fConverter(toAdopt)
 {
 }
@@ -688,10 +689,10 @@ DBGPRINTF1("Uniconv390LCPTranscoder::calcRequiredSize(const XMLCh* const srcText
    if (!*srcText)
       return 0;
 
-   char * result = transcode(srcText);
+   char * result = transcode(srcText, XMLPlatformUtils::fgMemoryManager);
    if (result) {
       thesize = strlen(result);
-      delete [] result;
+      XMLPlatformUtils::fgMemoryManager->deallocate(result);//delete [] result;
    }
    return thesize;
 }
@@ -706,10 +707,10 @@ DBGPRINTF1("Uniconv390LCPTranscoder::calcRequiredSize(const char* const srcText)
    if (!*srcText)
       return 0;
 
-   XMLCh * result = transcode(srcText);
+   XMLCh * result = transcode(srcText, XMLPlatformUtils::fgMemoryManager);
    if (result) {
       thesize = getWideCharLength(result);
-      delete [] result;
+      XMLPlatformUtils::fgMemoryManager->deallocate(result);//delete [] result;
    }
 
 DBGPRINTF2("Uniconv390LCPTranscoder::calcRequiredSize(const char* const srcText) %d  \n",thesize);
diff --git a/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.hpp b/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.hpp
index 7ffbafb8e9fad20a7530af79c05188548478e3a1..282844d95b4ba517e06aca8e6bb051b4425b7162 100644
--- a/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.hpp
+++ b/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.hpp
@@ -154,6 +154,7 @@ public :
         const   XMLCh* const        encodingName
         ,        uniconvconverter_t* const   toAdopt
         , const unsigned int        blockSize
+        , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
     );
     ~Uniconv390Transcoder();
 
diff --git a/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp b/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp
index 3a997adc61bd851caa23975d46f60c4106c7f103..d43b5896a03e93a4c6b1211348b4b760294a43df 100644
--- a/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp
+++ b/src/xercesc/util/Transcoders/Win32/Win32TransService.cpp
@@ -577,6 +577,7 @@ Win32TransService::makeNewXMLTranscoder(const   XMLCh* const            encoding
         , theEntry->getWinCP()
         , theEntry->getIEEncoding()
         , blockSize
+        , manager
     );
 }
 
@@ -600,9 +601,10 @@ Win32TransService::makeNewXMLTranscoder(const   XMLCh* const            encoding
 Win32Transcoder::Win32Transcoder(const  XMLCh* const    encodingName
                                 , const unsigned int    winCP
                                 , const unsigned int    ieCP
-                                , const unsigned int    blockSize) :
+                                , const unsigned int    blockSize
+                                , MemoryManager* const manager) :
 
-    XMLTranscoder(encodingName, blockSize)
+    XMLTranscoder(encodingName, blockSize, manager)
     , fIECP(ieCP)
     , fWinCP(winCP)
 {
diff --git a/src/xercesc/util/Transcoders/Win32/Win32TransService.hpp b/src/xercesc/util/Transcoders/Win32/Win32TransService.hpp
index d29814b311c6fada81f0bd38ff547ce9952d4755..7de8d3a69cc483e528201a3a34ec83f40473ba0b 100644
--- a/src/xercesc/util/Transcoders/Win32/Win32TransService.hpp
+++ b/src/xercesc/util/Transcoders/Win32/Win32TransService.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.6  2003/05/17 16:32:18  knoaman
+ * Memory manager implementation : transcoder update.
+ *
  * Revision 1.5  2003/05/15 18:47:07  knoaman
  * Partial implementation of the configurable memory manager.
  *
@@ -232,7 +235,8 @@ public :
         const   XMLCh* const    encodingName
         , const unsigned int    winCP
         , const unsigned int    ieCP
-        , const unsigned int    blockSize);
+        , const unsigned int    blockSize
+        , MemoryManager* const  manager = XMLPlatformUtils::fgMemoryManager);
     ~Win32Transcoder();