So that I understand the question. Are you creating outbound X12 from a flat file or some other type of data that may contain symbols such as |, *, :?
Is some knucklehead sending delimiters embeded within the elements?
in the former, I imagine if you have a way of determining what outbound TP it is from the flat file, you could look up the delimiters in the agreement like RMG mentions. That way you dont send out bogus X12.
However, in the latter, if an “" were included within an REF03 as part of a description, where that partner is using "” as the element separator. I think you need to reject the document and ask the TP to do a compliance check before sending.
This may just be my FED/DOD background talking, but you should never try to code for poorly formed X12. Since there is no limit to how badly a partner can attempt to create it, and it can lead to a mis interpretation.
I dont see how you could distinguish a delimiter from a wildcard in X12 received.