{"record":{"id":"2561103629ad905a","repo":"tui-cs/Terminal.Gui","slug":"value-invalid-combined-rune","errorCode":null,"errorMessage":"{value}: Invalid combined Rune.","messagePattern":"(.+?): Invalid combined Rune\\.","errorType":"exception","errorClass":"JsonException","httpStatus":null,"severity":"error","filePath":"Terminal.Gui/Configuration/RuneJsonConverter.cs","lineNumber":116,"sourceCode":"\n                    if (!Rune.IsValid (second))\n                    {\n                        throw new JsonException ($\"{value}: Invalid Rune. The second codepoint is not valid: {second}.\");\n                    }\n\n                    var cm = new Rune (second);\n\n                    if (!cm.IsCombiningMark ())\n                    {\n                        throw new JsonException ($\"{value}: Invalid Rune. The second codepoint is not a combining mark: {cm}.\");\n                    }\n\n                    // not a surrogate pair, so a combining mark + char?\n                    string combined = string.Concat ((char)first, (char)second).Normalize ();\n\n                    if (!Rune.IsValid (combined [0]))\n                    {\n                        throw new JsonException ($\"{value}: Invalid combined Rune.\");\n                    }\n\n                    return new (combined [0]);\n                }\n            case JsonTokenType.Number:\n                {\n                    uint num = reader.GetUInt32 ();\n\n                    if (Rune.IsValid (num))\n                    {\n                        return new (num);\n                    }\n\n                    throw new JsonException ($\"{num}: Invalid Rune (not a scalar Unicode value).\");\n                }\n            case JsonTokenType.Null:\n                return default;\n            default:","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/tui-cs/Terminal.Gui/blob/2e47b11478db083499917f2ad27c34d30efb0df1/Terminal.Gui/Configuration/RuneJsonConverter.cs#L98-L134","documentation":"The rarest Rune path: two codepoints formed a valid base+combining-mark and were normalized via string.Normalize(), but the normalized result's first char is not a valid Rune (Rune.IsValid fails on combined[0]). This indicates the normalization produced an unexpected leading code unit.","triggerScenarios":"A base+combining-mark pair whose normalized form starts with a lone surrogate or otherwise invalid scalar — an edge case from unusual or malformed codepoint combinations.","commonSituations":"Extremely rare; only with exotic combining sequences or input that confuses Unicode normalization. Essentially a data-integrity edge case.","solutions":["Use a precomposed (NFC) character instead of a base+combining pair (e.g. U+00E9 for é instead of U+0065+U+0301).","Replace the pair with a single valid codepoint."],"exampleFix":"// before\n\"Char\": \"U+0065U+0301\"\n// after\n\"Char\": \"U+00E9\"","handlingStrategy":"validation","validationCode":"static bool NormalizesToValidRune (char first, char second)\n{\n    string n = string.Concat (first, second).Normalize ();\n    return n.Length > 0 && System.Text.Rune.IsValid (n [0]);\n}","typeGuard":null,"tryCatchPattern":"try { ConfigurationManager.Apply (); }\ncatch (JsonException ex) when (ex.Message.Contains (\"Invalid combined Rune\"))\n{ /* report offending value from ex.Message */ }","preventionTips":["Prefer precomposed (NFC) codepoints in config (e.g. U+00E9, not U+0065+U+0301).","Test combining sequences in a unit test before shipping config."],"tags":["config","json","unicode","rune","edge-case"],"backgroundTag":null,"analyzedSha":"2e47b11478db083499917f2ad27c34d30efb0df1","analyzedAt":"2026-08-13T19:20:08.826Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}