php-edifact / edifact

Tools to process EDI messages in UN/EDIFACT format
GNU Lesser General Public License v3.0
274 stars 87 forks source link

question marks are not parsed correctly #91

Closed lhyx closed 1 year ago

lhyx commented 5 years ago

Hi,

Question marks should be added as ?? because it's an escape character.

In this example the question marks escape the ' and this should not happen:

ATT+1400+??????'
XRH+3'
$c = new \EDI\Parser();
$c->setStripRegex('//');
$c->loadString($edistring);
$message       = $c->get();

$message contains this:

[99] => Array
        (
            [0] => ATT
            [1] => 1400
            [2] => ???'XRH
            [3] => 3
        )

As you can see the question marks are correctly parsed into ??? but the ' is still escaped and this is not correct.

Any idea how this could be fixed ?

sabas commented 5 years ago

Are you using the latest version? Could you try with some previous tag?

lhyx commented 5 years ago

Hi,

I tried version 3.4 and then the ?????? is even not converted in ???. At the moment I'm using the last version (4.0).

tophsic commented 5 years ago

Is this related to #65?

lhyx commented 5 years ago

Hi,

I checked the issue before posting. But in the case of 6 question marks the issue still seems to occur. I'm using the latest version 4.0.

lhyx commented 5 years ago

Ow I see you released a fix some time ago to solve some of the question mark situations. So it seems in the case of 6 question marks the problem still occurs for some reason.