estratocloud / edifact

Parser and Serializer for UN/EDIFACT messages in PHP
Apache License 2.0
35 stars 9 forks source link

CR/LF not recognized in tests #4

Open nerdoc opened 6 years ago

nerdoc commented 6 years ago

Hi Craig, (I'm the one who translated your lib to Python) I just saw that your tests don't cover the possibility that EDIFACT files could have line breaks. the tests read the files line-wise, and cut out each "\n".

Other files (like in medical purpose) use lines like

UNA:+,? '[snip]
FTX+BFD++Herr
'FTX+BFD++Dr?. Max Musterarzt
'FTX+BFD++Beispielstraße?. 13
'[snip]

So there is a \n after each line, but before the ' - so that the \n is a part of the freetext there. It's not easy to check that correctly, but you can't just drop all "\n"s.

An (dumb) approach would be to drop all "\n" which follow an segment terminator...? (they are just for readability of an EDI file) Greetings from Salzburg, Christian

duncan3dc commented 6 years ago

Hi Christian,

Thanks very much for raising this, I'll take a look at the specification and see how new lines should be handled.