Skip to content

Batch Sysout: DISPLAY of a hex-literal byte >= X'80' is not byte-identical under a non-latin-1 record charset (cp037/cp1047/cp1252) #4698

Closed

Description

@squid-protocol

Found by the #4697 batch-path byte test. With the batch Sysout (_RUNTIME) and data.record_charset IBM037/IBM1047/windows-1252, MOVE X'80' TO R / DISPLAY R writes the record charset encoding of the char U+0080 (IBM1047: 0x20, windows-1252: 0x3F) and the line terminator as the charset encodes "\n" (0x15 for EBCDIC), where cobc writes the raw byte 0x80 and 0x0A. A hex literal (and the DISPLAY of a byte that came from one) does not round-trip its byte under a non-latin-1 charset: the literal is a latin-1 view of the byte, Sysout encodes it with the record charset. Under ISO-8859-1 all 128 bytes match (tests/cobol_mainframe/test_det_bytes_4690.py::test_batch_sysout_high_bytes_equal_gnucobols). Decide the intended semantics (hex literal bytes decoded through the record charset; whether the Sysout line terminator is charset-encoded) and fix. Part of #4270, follow-up to #4697.

Activity

  1. added
    bug
    legacy-modernization
    priority: low
    on Oct 8, 2026
  2. added
    scope:sweep
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglegacy-modernizationpriority: lowscope:sweep

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions