Skip to content

National characters (ÆØÅ ÄÖ) and Latin-1 sources: silent losses across JCL, CSD, HLASM, COBOL -- a torture estate in CI #3810

Closed

Description

@squid-protocol

Follow-up to #3520 (fixed in #3522 for PL/I unit names and the CALL verb only; that PR listed the resource readers as "not changed").

Evidence

A probe estate with Nordic characters in every kind of name was scanned with main (a14f8bbf): PL/I, COBOL (UTF-8 and Latin-1), JCL, CSD and HLASM. The same estate was also scanned transliterated to ASCII as a control. With ASCII names every channel is right, so every row below is caused by the letters.

channel source with the letters ASCII control
JCL step (unit) //ÆSTEG1 EXEC PGM=ØKONOMI missing AESTEG1
JCL EXEC PGM= call edge PGM=ØKONOMI missing: the job-to-program edge is lost (and so is its #3237 graph edge) resolves to the PL/I program
JCL DD //KUNDÆR DD DSN=PROD.KUNDEØ.DATA missing entirely present
JCL DSN DSN=PROD.ÅRSOPPGJØR(+1) PROD. (truncated at Å) PROD.ARSOPPGJOR(+1)
CSD DEFINE PROGRAM(ØKONOMI) / TRANSACTION(ÆB01) / FILE(KUNDÆR) no resources at all, so no transaction map or file lineage 3 resources
HLASM ØKASM CSECT no unit OKASM
COBOL, UTF-8 file paragraph 100-RÄKNA, item WS-HÄLSNING paragraph missing, item WS-H both present
COBOL, Latin-1 file 100-RÄKNA, CALL "ÖVERFÖR", WS-HÄLSNING 100-RKNA, VERFR, WS-HLSNING: bytes silently dropped right
PL/I units, DCL items, %INCLUDE ØKOREC, XCTL PROGRAM('BETALÅ'), READ FILE('KUNDÆR') right (#3522) right

Causes

  1. Decoding. galaxyscope.py:494 reads every source file as utf-8-sig with errors="ignore", so a Latin-1 or cp1252 file loses every non-ASCII byte without a word.
    • Names and literals corrupt: CALL "ÖVERFÖR" → VERFR.
    • For fixed-format sources each dropped byte also shifts the rest of the line one column left, so a line can pull its column 73-80 sequence field into column 72.
    • Mainframe exports are commonly Latin-1 / cp1252 / cp1047-converted, not UTF-8.
  2. ASCII-only name classes in the JCL, CSD and HLASM readers (and COBOL's word class). Keep Unicode and national characters in unit and callee names (#3520) #3522 widened only the shared unit-name normaliser and the CALL verb.

Proposal

  • Decode, never drop. Try UTF-8 first. If a file doesn't decode, fall back to Latin-1 (every byte is a character), or a code page the estate declares, and record which encoding each file used. Never errors="ignore".
  • Name classes per language, from the language rules:
    • where the language allows national characters (JCL, CSD, HLASM, PL/I, REXX, BMS): @ # $ plus Unicode letters (Nordic exports show @#$ as ÆØÅ/ÄÖ);
    • COBOL: Unicode letters in user-defined words and program-name literals. Enterprise COBOL words are ASCII-only, but Micro Focus / GnuCOBOL estates and converted sources carry them, and a literal program name may hold anything.
  • A torture estate in CI. The probe becomes a committed fixture, the same programs in UTF-8, Latin-1 and cp1252, plus the ASCII control, with an assertion per channel: units, calls and their resolution, datasets/DSNs, CSD resources, CICS resources, record items, lineage. Any channel that loses a character fails. Add a Swedish, a German (ÄÖÜß) and a French (é) variant.
  • Downstream: check the Java generator's identifiers and file names for these names, and the equivalence harness's encodings.

🤖 Generated with Claude Code

Activity

  1. added
    bug
    core-engine
    legacy-modernization
    priority: high
    on Sep 26, 2026
  2. squid-protocol commented on Sep 26, 2026

    @squid-protocol
    OwnerAuthor

    Folded into epic #3811 (international text foundation): this issue's probe becomes the gauntlet's mainframe seed, and its causes are parts 2 (decoding) and 3 (identifiers).

  3. added 3 commits that reference this issue on Sep 26, 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

    bugcore-enginelegacy-modernizationpriority: high

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions