You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ca...@apache.org on 2005/12/28 11:56:47 UTC

svn commit: r359481 - in /xerces/c/branches/xerces-2.7/src/xercesc/util/Transcoders/Uniconv390: Uniconv390TransService.cpp uniconv.cpp

Author: cargilld
Date: Wed Dec 28 02:56:45 2005
New Revision: 359481

URL: http://svn.apache.org/viewcvs?rev=359481&view=rev
Log:
Uniconv390 fixes.

Modified:
    xerces/c/branches/xerces-2.7/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp
    xerces/c/branches/xerces-2.7/src/xercesc/util/Transcoders/Uniconv390/uniconv.cpp

Modified: xerces/c/branches/xerces-2.7/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/branches/xerces-2.7/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp?rev=359481&r1=359480&r2=359481&view=diff
==============================================================================
--- xerces/c/branches/xerces-2.7/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp (original)
+++ xerces/c/branches/xerces-2.7/src/xercesc/util/Transcoders/Uniconv390/Uniconv390TransService.cpp Wed Dec 28 02:56:45 2005
@@ -97,6 +97,7 @@
 #define NO_FORCE 0
 #define MUST_USE_ICU  1
 #define MUST_USE_UNICONV  2
+#define MUST_USE_ICU_SRC_OFFS  3
 
 // ---------------------------------------------------------------------------
 //  Local functions
@@ -171,11 +172,14 @@
       gForceTranscode = MUST_USE_ICU;
    else if ( !strcmp(myenviron,"USE_NATIVE") )
       gForceTranscode = MUST_USE_UNICONV;
+   else if ( !strcmp(myenviron,"USE_ICU_SRC_OFFS") )
+      gForceTranscode = MUST_USE_ICU_SRC_OFFS;
   DBGPRINTF3("FORCE PARM=%s %d\n",myenviron,gForceTranscode);
 
-// If we are forcing ICU to be used fro transcoding then we also should
+// If we are forcing ICU to be used for transcoding then we also should
 // force it to be used for case conversions.
-if (gForceTranscode == MUST_USE_ICU) {
+if ((gForceTranscode == MUST_USE_ICU) ||
+    (gForceTranscode == MUST_USE_ICU_SRC_OFFS)) {
    fCaseConverter = new uniconvcaseconverter;
    fCaseConverter->ftoupperhand=UNICONV_ERROR;
    fCaseConverter->ftolowerhand=UNICONV_ERROR;
@@ -363,7 +367,10 @@
 
 bool Uniconv390TransService::supportsSrcOfs() const
 {
-   return false;
+   if (gForceTranscode == MUST_USE_ICU_SRC_OFFS)
+      return true;
+    else
+      return false;
 }
 
 void Uniconv390TransService::upperCase(XMLCh* const toUpperCase) const
@@ -439,7 +446,8 @@
    XMLTransService::Codes resValue;
 DBGPRINTF2("makeNewLCPTranscoder() localencoding=%s \n",nl_langinfo(CODESET));
    // USS default code page is IBM-1047
-   if (gForceTranscode == MUST_USE_ICU) {
+   if ((gForceTranscode == MUST_USE_ICU) ||
+       (gForceTranscode == MUST_USE_ICU_SRC_OFFS)) {
       if (gViewTranscoder)
          printf("IXM1004I LCP - Using ICU - %s\n",nl_langinfo(CODESET));
       fLCPTranscoder = fICUService->makeNewLCPTranscoder();
@@ -477,7 +485,8 @@
 ArrayJanitor<char> janText((char*)localname, manager);
 DBGPRINTF3("makeNewXMLTranscoder() encoding=%s blocksize=%d\n",localname,blockSize);
 
-   if (gForceTranscode == MUST_USE_ICU) {
+   if ((gForceTranscode == MUST_USE_ICU) ||
+       (gForceTranscode == MUST_USE_ICU_SRC_OFFS)) {
       if (gViewTranscoder)
          printf("IXM1001I XML - Using ICU - %s\n",localname);
       return fICUService->makeNewXMLTranscoder(encodingName,resValue,blockSize, manager);

Modified: xerces/c/branches/xerces-2.7/src/xercesc/util/Transcoders/Uniconv390/uniconv.cpp
URL: http://svn.apache.org/viewcvs/xerces/c/branches/xerces-2.7/src/xercesc/util/Transcoders/Uniconv390/uniconv.cpp?rev=359481&r1=359480&r2=359481&view=diff
==============================================================================
--- xerces/c/branches/xerces-2.7/src/xercesc/util/Transcoders/Uniconv390/uniconv.cpp (original)
+++ xerces/c/branches/xerces-2.7/src/xercesc/util/Transcoders/Uniconv390/uniconv.cpp Wed Dec 28 02:56:45 2005
@@ -23,7 +23,7 @@
 #include <string.h>
 #include <errno.h>
 #include <ctype.h>
-#include <cunhc.h>
+#include <cunhc.h>           
 #include "ccsid.h"
 #include "uniconv.h"
 
@@ -139,8 +139,14 @@
    tmpp->DDA_Buf_Len=DDA_NEEDED;
    // This flag tells the services to automatically refresh the handle if it
    // becomes invalid.
-   tmpp->Flag1|=CUNBCPRM_REFRESH_AT_INV_HANDLE_START;
-   tmpp->Flag1|=CUNBCPRM_SUB_ACTION_SUBSTITUTE;
+
+// Use next two lines of code on old z/OS levels where Flag1 is is char field
+// tmpp->Flag1|=CUNBCPRM_REFRESH_AT_INV_HANDLE_START;
+// tmpp->Flag1|=CUNBCPRM_SUB_ACTION_SUBSTITUTE;
+
+// Use next two lines of code on later z/OS levels where Flag1 is bit field
+   tmpp->Flag1.Inv_Handle = 1;
+   tmpp->Flag1.Sub_Action = 1;
 
    /* Determine which technique to use */
    if ( (srcis390) || (destis390) )
@@ -266,7 +272,12 @@
    tmpp->DDA_Buf_Len=CUNBAPRM_DDA_REQ;
    // This flag tells the services to automatically refresh the handle if it
    // becomes invalid.
-   tmpp->Flag1|=CUNBAPRM_REFRESH_AT_INV_HANDLE_START;
+
+// Use next line of code on old z/OS levels where Flag1 is char field
+// tmpp->Flag1|=CUNBAPRM_REFRESH_AT_INV_HANDLE_START;
+
+// Use next line of code on later z/OS levels where Flag1 is bit field
+   tmpp->Flag1.Inv_Handle = 1;
 
    unichar_t inchar = 0x61;
    unichar_t outchar;



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org