Skip to content

Porting ticket: the records' code page is never stated -- a model guessed IBM037 for Latin-1 data #4060

Closed

Description

@squid-protocol

What. The porting ticket never tells the model which code page the record bytes are in.

Found re-running the porting loop on CBTRN03C for #4056 (2026-10-01): attempt 1 decoded every record as IBM037 (EBCDIC) while the case's data is ISO-8859-1. The records came out garbled, the dates blank, and the step abended. The SYSOUT comparison showed it plainly, and attempt 2 switched to ISO-8859-1 and was proven. The earlier committed port happened to pick ISO-8859-1. Nothing in the ticket decides it: the only code-page words in it are about EBCDIC key collation (rules 15/16), which plausibly invite the wrong guess.

Why it matters. A port's charset is a deployment fact, not something a model should guess: the estate's data may be EBCDIC on the mainframe and ASCII or UTF-8 after migration (#3815 declared encodings). A wrong guess is a whole-program defect that a thin case might not catch.

Fix:

  • The ticket states the records' code page as configuration: a generated DataCharset (or CobolRecords.CHARSET) bound to the target config / the case's data_encoding. A rule says every record is read and written through it, never Charset.forName(...) in a port.
  • The harness sets it from the case's data encoding, so a port that hard-codes a charset fails the proof on a non-Latin-1 case (e.g. a cp277 or UTF-8 multicultural case).

Part of epic #4055 (the product is the proof).

🤖 Generated with Claude Code

Activity

  1. added
    bug
    legacy-modernization
    on Oct 1, 2026
  2. added a commit that references this issue on Oct 1, 2026
  3. added
    scope:core
    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-modernizationscope:core

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions