From 2b32f97ad7f58c5aa815b5361f10a50f6c5e9bc4 Mon Sep 17 00:00:00 2001 From: James David Berry <jberry@apache.org> Date: Tue, 26 Aug 2003 13:58:49 +0000 Subject: [PATCH] Fix bug #22697; transcodeFrom incorrectly throws on kTECOutputBufferFullStatus. Thanks to benoit.blaquiere@ign.fr git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@175167 13f79535-47bb-0310-9956-ffa450edef68 --- .../MacOSUnicodeConverter/MacOSUnicodeConverter.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp b/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp index 3c4bea9e4..fe176a361 100644 --- a/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp +++ b/src/xercesc/util/Transcoders/MacOSUnicodeConverter/MacOSUnicodeConverter.cpp @@ -655,13 +655,11 @@ MacOSTranscoder::transcodeFrom( const XMLByte* const srcData &bytesProduced, reinterpret_cast<UniCharArrayPtr>(toFill)); - if (status == kTECUsedFallbacksStatus) + if (status == kTECOutputBufferFullStatus || status == kTECUsedFallbacksStatus) status = noErr; if (status != noErr) - { ThrowXML(TranscodingException, XMLExcepts::Trans_BadSrcSeq); - } std::size_t charsProduced = bytesProduced / sizeof(UniChar); @@ -773,14 +771,6 @@ MacOSTranscoder::transcodeTo(const XMLCh* const srcData , getEncodingName() ); } - - // These were removed because we actually have succeeded in transcoding part of - // the string; this logic should probably be changed to deal with non-transcodable - // text somehow; if options != UnRep_Throw, and we zero these values, we get in - // to an infinite loop and hang the machine - - //totalCharsConsumed = 0; - //totalCharsProduced = 0; } charsEaten = totalCharsConsumed; -- GitLab