From cea49b6c0c13e971c78362b8359498ca67d237a6 Mon Sep 17 00:00:00 2001 From: "Unknown (aruna1)" <dev-null@apache.org> Date: Fri, 28 Jul 2000 23:29:22 +0000 Subject: [PATCH] ICU 1.6 pre-release related chages in. git-svn-id: https://svn.apache.org/repos/asf/xerces/c/trunk@172285 13f79535-47bb-0310-9956-ffa450edef68 --- src/util/Transcoders/ICU/ICUTransService.cpp | 44 ++++++++++++++------ 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/src/util/Transcoders/ICU/ICUTransService.cpp b/src/util/Transcoders/ICU/ICUTransService.cpp index 1280ce41f..3bdf16727 100644 --- a/src/util/Transcoders/ICU/ICUTransService.cpp +++ b/src/util/Transcoders/ICU/ICUTransService.cpp @@ -529,11 +529,16 @@ ICUTranscoder::transcodeTo( const XMLCh* const srcData // the rep char. Remember the old one so we can put it back. // UErrorCode err = U_ZERO_ERROR; - UConverterFromUCallback oldCB = ucnv_setFromUCallBack + UConverterFromUCallback oldCB = NULL; + void* orgContent; + ucnv_setFromUCallBack ( (UConverter*)&fConverter , (options == UnRep_Throw) ? UCNV_FROM_U_CALLBACK_STOP : UCNV_FROM_U_CALLBACK_SUBSTITUTE + , NULL + , &oldCB + , &orgContent , &err ); @@ -561,7 +566,9 @@ ICUTranscoder::transcodeTo( const XMLCh* const srcData // Put the old handler back err = U_ZERO_ERROR; - ucnv_setFromUCallBack(fConverter, oldCB, &err); + UConverterFromUCallback orgAction = NULL; + + ucnv_setFromUCallBack(fConverter, oldCB, NULL, &orgAction, &orgContent, &err); if (!res) { @@ -608,13 +615,19 @@ bool ICUTranscoder::canTranscodeTo(const unsigned int toCheck) const // Set the callback so that it will fail instead of using the rep char. // Remember the old one so we can put it back. // - UErrorCode err = U_ZERO_ERROR; - UConverterFromUCallback oldCB = ucnv_setFromUCallBack - ( - (UConverter*)&fConverter - , UCNV_FROM_U_CALLBACK_STOP - , &err - ); + UErrorCode err = U_ZERO_ERROR; + UConverterFromUCallback oldCB = NULL; + void* orgContent; + + ucnv_setFromUCallBack + ( + (UConverter*)&fConverter + , UCNV_FROM_U_CALLBACK_STOP + , NULL + , &oldCB + , &orgContent + , &err + ); // Set upa temp buffer to format into. Make it more than big enough char tmpBuf[64]; @@ -636,11 +649,13 @@ bool ICUTranscoder::canTranscodeTo(const unsigned int toCheck) const // Save the result before we overight the error code const bool res = (err == U_ZERO_ERROR); - + // Put the old handler back err = U_ZERO_ERROR; - ucnv_setFromUCallBack(fConverter, oldCB, &err); - + UConverterFromUCallback orgAction = NULL; + + ucnv_setFromUCallBack(fConverter, oldCB, NULL, &orgAction, &orgContent, &err); + return res; } @@ -693,6 +708,7 @@ unsigned int ICULCPTranscoder::calcRequiredSize(const XMLCh* const srcText) , 0 , 0 , (const UChar*)srcText + , -1 , &err ); } @@ -713,6 +729,7 @@ unsigned int ICULCPTranscoder::calcRequiredSize(const XMLCh* const srcText) , 0 , 0 , tmpBuf + , -1 , &err ); } @@ -816,6 +833,7 @@ char* ICULCPTranscoder::transcode(const XMLCh* const toTranscode) , retBuf , targetLen + 1 , actualSrc + , -1 , &err ); } @@ -839,6 +857,7 @@ char* ICULCPTranscoder::transcode(const XMLCh* const toTranscode) , retBuf , targetCap , actualSrc + , -1 , &err ); } @@ -1066,6 +1085,7 @@ bool ICULCPTranscoder::transcode( const XMLCh* const toTranscode , toFill , maxChars , actualSrc + , -1 , &err ); } -- GitLab