Skip to content

File with component element separator (ISA16) of 0x1d is unparsable #189

@coenwulf

Description

@coenwulf

I have received some x12 214 files that have a value of \u001d (character 29) in position 105 of the file (which is the value for ISA16, the component element separator). When I try to parse those files using stupidedi it gets a fatal error that seems to indicate that it's skipping that character. It gets the S and the field separator (\u001e) instead of GS as the segment identifier and doesn't like it. The error is found "S\u001E" instead of segment identifier. But when I replace that character with a different one (e.g., _) it works fine.
Is there a way to get it to accept that character (\u001d) as the component element separator?

For what it's worth, my code to that point looks basically like:

    config = Stupidedi::Config.contrib
    parser = Stupidedi::Builder::StateMachine.build(config)
    machine, result = parser.read(Stupidedi::Reader.build(file))

    if result.fatal?
      result.explain {|reason| raise EDI214Error.new(reason + " at #{result.position.inspect}") }
    end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions