Trailing spaces not counted in EDIFACT record length

Bots is not taking into account the trailing spaces in EDIFACT records, when checking the maximum length.

Example: 

RFF record (data element) C506.1154 has a max. 35 characters.

Such a segment:

RFF+ON:01234567xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

gives an error: Record "UNH-CPS-LIN-RFF" field "C506.1154" too big (max 35): "01234567xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".


However this segment with trailing spaces:

RFF+ON:01234567                                                              '

gives no error.

Attached two test DESADV files:

  • test1_xxxx.edi - "too big" error is reported correctly,
  • test2_spaces.edi - no error, while the length of data is the same.

test1_xxxx.txt test2_spaces.txt