Skip to content

Fix #3958: Support ASCII code pages and PC-COBOL zoned signs in Target config - #3961

Merged
squid-protocol merged 4 commits into
mainfrom
fix/3958-ascii-zoned-decimals
Sep 28, 2026
Merged

squid-protocol merged 4 commits into
mainfrom
fix/3958-ascii-zoned-decimals

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Resolves #3958.

Changes:

  • Updates zoned_sign_characters() to support ASCII-family text encodings (like shift_jis, utf-8, cp1252) by detecting them based on how they decode 0x30.
  • Provides the standard PC-COBOL zoned-decimal signs ({ABCDEFGHI and }JKLMNOPQR) when an ASCII-family encoding is used.
  • Raises a precise error for unsupported code pages rather than silently returning corrupted sign characters.
  • Includes new unit tests verifying both ASCII success and failure on unknown/unsupported codecs (e.g. utf-16).

Allows 'data.code_page' to accept ASCII-family encodings (like shift_jis, utf-8, cp1252) and maps them to the standard PC-COBOL zoned-decimal signs ({ABCDEFGHI / }JKLMNOPQR). Also ensures an unknown or incompatible code page explicitly fails rather than silently misreading signs.
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

try:
if bytes([0xF0]).decode(cp) == "0":
return bytes(range(0xC0, 0xCA)).decode(cp), bytes(range(0xD0, 0xDA)).decode(cp)
except UnicodeDecodeError:
try:
if bytes([0x30]).decode(cp) == "0":
return "{ABCDEFGHI", "}JKLMNOPQR"
except UnicodeDecodeError:
@squid-protocol
squid-protocol merged commit 1383c88 into main Sep 28, 2026
37 checks passed
@squid-protocol
squid-protocol deleted the fix/3958-ascii-zoned-decimals branch September 28, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants