Relationship between encoding conversion and UPoCs

The inbound encoding conversion happens before the message is passed to the inbound TPS. Outbound encoding conversion happens after the prewrite UPoC is called. The message data that is passed to all UPoCs are Unicode strings except as noted. The metadata does not get encoding conversion so metadata is always Unicode strings.

UPoC protocol read and write procedures communicate directly with the outside so they deal with encoded byte arrays. Encoding conversion for a UPoC protocol read happens after the read procedure passes the message to the engine. UPoC read and UPoC write are the only procedures that deal with encoded data. All others deal with Unicode strings.