{"record":{"id":"01ebe75465441d6e","repo":"microsoft/edit","slug":"unrecognized-ea-for-u-04x-to-u-04x","errorCode":null,"errorMessage":"Unrecognized ea={} for U+{:04X} to U+{:04X}","messagePattern":"Unrecognized ea=(.+?) for U\\+(.+?) to U\\+(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/unicode-gen/src/main.rs","lineNumber":860,"sourceCode":"                    );\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                ),\n            };\n\n            // There's no \"ea\" attribute for \"zero width\" so we need to do that ourselves. This matches:\n            //   Me: Mark, enclosing\n            //   Mn: Mark, non-spacing\n            //   Cf: Control, format\n            match char_attributes.general_category {\n                \"Cf\" if cb == ClusterBreak::Control => {\n                    // A significant portion of Cf characters are not just gc=Cf (= commonly considered zero-width),\n                    // but also GCB=CN (= does not join). This is a bit of a problem for terminals,\n                    // because they don't support zero-width graphemes, as zero-width columns can't exist.\n                    // So, we turn all of them into Extend, which is roughly how wcswidth() would treat them.\n                    cb = ClusterBreak::Extend;","sourceCodeStart":842,"sourceCodeEnd":878,"githubUrl":"https://github.com/microsoft/edit/blob/826b4c097b6f14ba0a846dc56f2f0223a3aaf73a/crates/unicode-gen/src/main.rs#L842-L878","documentation":"This error is thrown when generating Unicode character-width tables from UCD (Unicode Character Database) data: a row in the EastAsianWidth.txt source data has an east_asian width property value the generator does not recognize. The generator only accepts N, Na, H (narrow), F, W (wide), and A (ambiguous); any other classified value means the UCD file format changed or the data is corrupt, so bailing out prevents silently mis-classifying an entire codepoint range.","triggerScenarios":"Running `unicode-gen` (extract_values_from_ucd) against a UCD EastAsianWidth.txt whose ea column contains a value outside {N, Na, H, F, W, A} — e.g. a newer Unicode revision adding a new property value, a truncated/edited file, or a column-parsing bug shifting the wrong field into char_attributes.east_asian.","commonSituations":"Regenerating tables after a Unicode version bump that introduces a new East_Asian_Width value; pointing the generator at the wrong (non-EastAsianWidth) UCD file so unrelated column data lands in the ea field; hand-patched or partially downloaded UCD data files.","solutions":["Check the actual ea value in the error message against the current Unicode EastAsianWidth.txt spec; if it is a newly introduced property value, add it to the match arms in crates/unicode-gen/src/main.rs and map it to the correct CharacterWidth","Verify you downloaded the correct, untruncated EastAsianWidth.txt for your target Unicode version and that the parser extracts the intended column","If the value should be treated as ambiguous/narrow per your project's policy, extend the match (e.g. map it alongside \"A\" via ambiguous_value)","Re-run the generator and confirm the range (U+start to U+end) is now classified correctly"],"exampleFix":"// before\nlet mut cw = match char_attributes.east_asian {\n    \"N\" | \"Na\" | \"H\" => CharacterWidth::Narrow,\n    \"F\" | \"W\" => CharacterWidth::Wide,\n    \"A\" => ambiguous_value,\n    _ => bail!(\"Unrecognized ea={} for U+{:04X} to U+{:04X}\", ...),\n};\n// after\nlet mut cw = match char_attributes.east_asian {\n    \"N\" | \"Na\" | \"H\" => CharacterWidth::Narrow,\n    \"F\" | \"W\" => CharacterWidth::Wide,\n    \"A\" => ambiguous_value,\n    \"new-ea-value\" => CharacterWidth::Wide, // handle newly introduced UCD value\n    _ => bail!(\"Unrecognized ea={} for U+{:04X} to U+{:04X}\", ...),\n};","handlingStrategy":"validation","validationCode":"const VALID_EA: &[&str] = &[\"N\", \"Na\", \"H\", \"F\", \"W\", \"A\"];\nif !VALID_EA.contains(&char_attributes.east_asian) {\n    eprintln!(\"ea value '{}' for U+{:04X} unsupported by this generator version\", char_attributes.east_asian, range.start());\n}\n// Or pre-scan the UCD file: grep -v -E '^.*;\\s*(N|Na|H|F|W|A)\\s*(#.*)?$' EastAsianWidth.txt","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin the Unicode UCD version you generate against and review its EastAsianWidth.txt property-value list on each upgrade","Before running the generator, scan the ea column for values outside {N,Na,H,F,W,A}","Keep the match arms in sync with the Unicode annex (UAX #11) when bumping Unicode versions","Never hand-edit UCD data files; download them fresh from the official source"],"tags":["unicode","codegen","parsing","invalid-enum-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"}