FAILURE MAP
← Case archive

FA-3346 / Encodings / Open access

Adjacent encoded words retain separating whitespace · case 01

Adjacent encoded words retain separating whitespace.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The implementation applies an operation whose text or grammar semantics violate this contract: Decode RFC-style encoded words through the standard email header codec.

THE FAILURE

The implementation applies an operation whose text or grammar semantics violate this contract: Decode RFC-style encoded words through the standard email header codec.

Unsuccessful approach: The attempted repair handles the primary example but still violates a separate boundary of the same contract.

Case contract

Decode RFC-style encoded words through the standard email header codec.

Why this case matters

A local executable model for consumers of structured text; oracle values are authored literals, not outputs copied from the repaired implementation.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        return x
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('=?utf-8?q?caf=C3=A9?='), 'café')
check('boundary 2', solve('=?utf-8?q?a?= =?utf-8?q?b?='), 'ab')
check('boundary 3', solve('plain'), 'plain')
check('boundary 4', solve('=?iso-8859-1?q?=E9?='), 'é')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
boundary 1=?utf-8?q?caf=C3=A9?=caféFailed
boundary 2=?utf-8?q?a?= =?utf-8?q?b?=abFailed
boundary 3plainplainPassed
boundary 4=?iso-8859-1?q?=E9?=éFailed

SHA-256 / 8b661da02394a1419e087498e3d92e1591284d52d651610db79098c83be90013

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        return ' '.join(str(make_header(decode_header(v))) for v in x.split())
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('=?utf-8?q?caf=C3=A9?='), 'café')
check('boundary 2', solve('=?utf-8?q?a?= =?utf-8?q?b?='), 'ab')
check('boundary 3', solve('plain'), 'plain')
check('boundary 4', solve('=?iso-8859-1?q?=E9?='), 'é')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
boundary 1cafécaféPassed
boundary 2a babFailed
boundary 3plainplainPassed
boundary 4ééPassed

SHA-256 / 3c946506892a4f0a895d5beefccc20e8a358c74f19dd811b14c01ebf035f9f22

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 4 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:37:24.501874+00:00.

Case digest / ae66af689f19f2a3d34b9a34b27471e9dbc3c9712e1680247974d503b6f0f9cb