imsweb/x12-parser

Handling apostrophes in elements in `toX12String()`

nddipiazza opened this issue · 2 comments

I am loading x12 documents, making changes, then writing them back to x12 using X12Writer.toX12String().

I'm having situations where I get x12 documents fail on the source system, and it is due to the fact that the x12 has apostrophes in the element value.

Is there something I should be doing to "escape" apostrophes? How do ya'll handle these?

For example NM103 has "O'Brian" how should that look in x12?

As far as I know, x12 doesn't use an escape character. In the X12 document I have seen the apostrophe appears on its own without any escaping. We haven't had any issues dealing with apostrophes.

Yeah that's what the documentation was saying too. Unless I was accidentally using them as separators but I wasn't. So I wonder why it's blowing up.