Repository navigation
#3815 (part 3): the equivalence harness takes a declared encoding for sources and data - #3906
Merged
Merged
Conversation
… sources and data The harness read COBOL sources and every record byte as Latin-1. A UTF-8 estate's national names (BELØP, नाम) and an EBCDIC record (cp277 æøå, overpunched zoned fields) were compared wrongly or silently mangled. One declaration, two parts, from a case's "source_encoding" / "data_encoding" or --source-encoding / --data-encoding: - source_encoding: sources are read by the engine's read_source ladder (BOM, UTF-8, the declared page, cp1252, Latin-1) and staged for GnuCOBOL in the encoding they were read in (UTF-8 when that page is not ASCII-family); - data_encoding: the record bytes' page for input files (_fixed), generated inputs, CICS areas, decode_field, the diff and the Java test's record Charset. Default Latin-1: an undeclared run is byte-identical (pinned by tests). An EBCDIC data page can be decoded and diffed but not run under GnuCOBOL, and says so. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 3 of #3815 (epic #3811, plan section 4 "Downstream": equivalence harness: a declared-encoding path for sources and data). Part 1 was #3896; part 2, NFC paths, is in progress.
Problem
The COBOL-vs-Java equivalence harness read COBOL sources and every record byte as Latin-1. A UTF-8 estate's national names (
BELØP,नाम) and an EBCDIC record (cp277æøå, overpunched zoned fields) were compared wrongly or silently mangled.Change
One declaration with two parts. It comes from a case's
source_encoding/data_encoding, or from the--source-encoding/--data-encodingflags:source_encoding: sources are read by the engine'sread_sourceladder (BOM, UTF-8, the declared page, cp1252, Latin-1). They are staged for GnuCOBOL in the encoding they were read in, or in UTF-8 when that page is not ASCII-family.data_encoding: the code page of the record bytes. It applies to:_fixed) and generated inputs;decode_fieldand the diff;Charset.Default is Latin-1, so an undeclared run is byte-identical to before; tests pin this. An EBCDIC data page can be decoded and diffed but not run under GnuCOBOL, and the harness says so rather than running it wrongly.
Files:
tests/tools/equivalence.py,equivalence_common.py,equivalence_cics.py,equivalence_inputs.py,equivalence_java.py, and the newtests/cobol_mainframe/test_equivalence_encodings.py. Test tooling only; no engine code.Checks
CI passes (28 checks, 1 skipped). The subagent's local gate report and my review are still to come before merge.
🤖 Generated with Claude Code