{"record":{"id":"24a0444bb1d44772","repo":"microsoft/edit","slug":"unrecognized-incb-for-u-04x-to-u-04x","errorCode":null,"errorMessage":"Unrecognized InCB={} for U+{:04X} to U+{:04X}","messagePattern":"Unrecognized InCB=(.+?) for U\\+(.+?) to U\\+(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/unicode-gen/src/main.rs","lineNumber":847,"sourceCode":"            }\n\n            if !matches!(char_attributes.indic_conjunct_break, \"None\" | \"Extend\") {\n                // If it's not None/Extend, it's Linker/Consonant, and currently\n                // all of them are GCB=EX/XX. Since we treat them almost like extenders,\n                // we need to revisit our assumptions if this ever changes.\n                if !matches!(cb, ClusterBreak::Other | ClusterBreak::Extend) {\n                    bail!(\n                        \"Unexpected GCB={} with InCB={} for U+{:04X} to U+{:04X}\",\n                        char_attributes.grapheme_cluster_break,\n                        char_attributes.indic_conjunct_break,\n                        range.start(),\n                        range.end()\n                    );\n                }\n                cb = match char_attributes.indic_conjunct_break {\n                    \"Linker\" => ClusterBreak::InCBLinker,\n                    \"Consonant\" => ClusterBreak::InCBConsonant,\n                    _ => bail!(\n                        \"Unrecognized InCB={} for U+{:04X} to U+{:04X}\",\n                        char_attributes.indic_conjunct_break,\n                        range.start(),\n                        range.end()\n                    ),\n                };\n            }\n\n            let mut cw = match char_attributes.east_asian {\n                \"N\" | \"Na\" | \"H\" => CharacterWidth::Narrow, // Half-width, Narrow, Neutral\n                \"F\" | \"W\" => CharacterWidth::Wide,          // Wide, Full-width\n                \"A\" => ambiguous_value,                     // Ambiguous\n                _ => bail!(\n                    \"Unrecognized ea={} for U+{:04X} to U+{:04X}\",\n                    char_attributes.east_asian,\n                    range.start(),\n                    range.end()\n                ),","sourceCodeStart":829,"sourceCodeEnd":865,"githubUrl":"https://github.com/microsoft/edit/blob/826b4c097b6f14ba0a846dc56f2f0223a3aaf73a/crates/unicode-gen/src/main.rs#L829-L865","documentation":"After validating the GCB/InCB combination, the generator maps the Indic_Conjunct_Break string to InCBLinker/InCBConsonant; any other non-None/non-Extend string reaches the catch-all bail. Like the GCB check, this protects the exhaustiveness of generated tables against unknown Unicode data values.","triggerScenarios":"A UCD XML containing an Indic_Conjunct_Break value outside {None, Extend, Linker, Consonant} — a newer Unicode property value, a misspelled/hand-edited attribute, or a different UCD property accidentally parsed into indic_conjunct_break.","commonSituations":"Future Unicode versions adding InCB values; corrupted or third-party-modified UCD files; wiring the wrong XML attribute into char_attributes.indic_conjunct_break during a refactor.","solutions":["Use the official UCD XML matching the generator's supported Unicode version.","Add the new InCB value to ClusterBreak and a mapping arm in extract_values_from_ucd.","Verify the field is populated from the Indic_Conjunct_Break attribute (check the parsing code) if values look shifted."],"exampleFix":"// before\n_ => bail!(\"Unrecognized InCB={} ...\"),\n// after\n\"NewKind\" => ClusterBreak::InCBNewKind,\n_ => bail!(\"Unrecognized InCB={} ...\"),","handlingStrategy":"try-catch","validationCode":"// validate InCB attribute domain before generating\nconst INCB_VALUES: &[&str] = &[\"None\", \"Extend\", \"Linker\", \"Consonant\"];\nfor node in doc.descendants().filter(|n| n.has_attribute(\"InCB\")) {\n    let v = node.attribute(\"InCB\").unwrap();\n    assert!(INCB_VALUES.contains(&v), \"unknown InCB value {v}\");\n}","typeGuard":null,"tryCatchPattern":"match generate(&ucd_path) {\n    Err(e) if e.to_string().starts_with(\"Unrecognized InCB=\") => {\n        eprintln!(\"UCD contains an InCB value this generator does not model: {e}\");\n        std::process::exit(1);\n    }\n    r => r?,\n}","preventionTips":["Use official unmodified UCD XML files only.","Pin the UCD version; re-validate the InCB value domain on Unicode upgrades.","After refactors, confirm indic_conjunct_break is parsed from the Indic_Conjunct_Break attribute."],"tags":["unicode","codepoint-data","unrecognized-value"],"backgroundTag":"invalid-enum-value","analyzedSha":"826b4c097b6f14ba0a846dc56f2f0223a3aaf73a","analyzedAt":"2026-09-06T13:30:05.543Z","contentChangedAt":"2026-09-06T13:30:05.543Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}