microsoft/edit · error
Unrecognized ea={} for U+{:04X} to U+{:04X}
Error message
Unrecognized ea={} for U+{:04X} to U+{:04X} What it means
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.
Source
Thrown at crates/unicode-gen/src/main.rs:860
);
}
cb = match char_attributes.indic_conjunct_break {
"Linker" => ClusterBreak::InCBLinker,
"Consonant" => ClusterBreak::InCBConsonant,
_ => bail!(
"Unrecognized InCB={} for U+{:04X} to U+{:04X}",
char_attributes.indic_conjunct_break,
range.start(),
range.end()
),
};
}
let mut cw = match char_attributes.east_asian {
"N" | "Na" | "H" => CharacterWidth::Narrow, // Half-width, Narrow, Neutral
"F" | "W" => CharacterWidth::Wide, // Wide, Full-width
"A" => ambiguous_value, // Ambiguous
_ => bail!(
"Unrecognized ea={} for U+{:04X} to U+{:04X}",
char_attributes.east_asian,
range.start(),
range.end()
),
};
// There's no "ea" attribute for "zero width" so we need to do that ourselves. This matches:
// Me: Mark, enclosing
// Mn: Mark, non-spacing
// Cf: Control, format
match char_attributes.general_category {
"Cf" if cb == ClusterBreak::Control => {
// A significant portion of Cf characters are not just gc=Cf (= commonly considered zero-width),
// but also GCB=CN (= does not join). This is a bit of a problem for terminals,
// because they don't support zero-width graphemes, as zero-width columns can't exist.
// So, we turn all of them into Extend, which is roughly how wcswidth() would treat them.
cb = ClusterBreak::Extend;View on GitHub (pinned to 826b4c097b)
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
Example fix
// before
let mut cw = match char_attributes.east_asian {
"N" | "Na" | "H" => CharacterWidth::Narrow,
"F" | "W" => CharacterWidth::Wide,
"A" => ambiguous_value,
_ => bail!("Unrecognized ea={} for U+{:04X} to U+{:04X}", ...),
};
// after
let mut cw = match char_attributes.east_asian {
"N" | "Na" | "H" => CharacterWidth::Narrow,
"F" | "W" => CharacterWidth::Wide,
"A" => ambiguous_value,
"new-ea-value" => CharacterWidth::Wide, // handle newly introduced UCD value
_ => bail!("Unrecognized ea={} for U+{:04X} to U+{:04X}", ...),
}; Defensive patterns
Strategy: validation
Validate before calling
const VALID_EA: &[&str] = &["N", "Na", "H", "F", "W", "A"];
if !VALID_EA.contains(&char_attributes.east_asian) {
eprintln!("ea value '{}' for U+{:04X} unsupported by this generator version", char_attributes.east_asian, range.start());
}
// Or pre-scan the UCD file: grep -v -E '^.*;\s*(N|Na|H|F|W|A)\s*(#.*)?$' EastAsianWidth.txt Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Unrecognized GCB={} for U+{:04X} to U+{:04X}
- Unexpected GCB={} with ExtPict=Y for U+{:04X} to U+{:04X}
- Unexpected GCB={} with InCB={} for U+{:04X} to U+{:04X}
- Unrecognized InCB={} for U+{:04X} to U+{:04X}
AI-assisted analysis of microsoft/edit@826b4c097b (2026-09-06).
Data as JSON: /api/errors/01ebe75465441d6e.
Report an issue: GitHub.