We have two inbound nodes that accept messages from mainframe systems that arrive in quasi-EBCDIC. Quasi-EBCDIC is my term for EBCDIC characters mixed with binary fields. Because the binary fields must be treated in a special manner, we must set encoding to binary on the inbound Encoding field and perform the translation ourselves.
Inbound Node1 performs this translation via a Tcl proc invoked as an IB TPS. It transforms the binary fields with custom logic and decodes the rest of the message using one of the tables referenced through msgmapdata. Inbound Node2 performs that translation through a Tcl proc invoked as a route detail pre proc. I’m told this was because the EBCDIC-to-UTF8 conversion depended on the destination which wasn’t known until the translation thread.
In the absence of errors, both schemes work, even though both are scary. When an error is encountered within the translation thread, a message is added to the error DB. Error DB entries from Node1 have valid (UTF8) contents. Error DB entries from Node2 have corrupt somewhat-EBCDIC contents. When dumped and decoded with hciencode (cp037), there is some recognizable content; but the character “C” is inserted between most other characters.
My suspicion is that Node1 recovers successfully because it completes manual EBCDIC to UTF8 encoding in the protocol thread and this message makes it intact to the pre translation queue. If an error occurs during translation, it is the message in the pre translation queue that is used to populate the error DB. Node2, on the otherhand, places quasi-EBCDIC on the pre translation queue. If the Node2 translation rule encounters an error, Cloverleaf takes over a message in the pre translation queue that is not valid UTF8. Cloverleaf fails to attempt to interpret this as UTF8 (the way it expects all messages internal to the engine) and the resulting content in the error DB is the failed decoding.
Does that seem like a sensible explanation?
My work around for now is to go dig it out of the inbound SMAT and resend from there (after I’ve fixed what caused the error in the first place).