fix output of non-BMP Unicode characters in NetDriver

This commit is contained in:
Chris Pacejo
2022-11-05 00:52:09 -04:00
parent a65831a4cb
commit cb7c1be8bc
2 changed files with 8 additions and 2 deletions

View File

@@ -1483,7 +1483,13 @@ namespace Terminal.Gui {
output.Append (WriteAttributes (attr));
}
outputWidth++;
output.Append ((char)contents [row, col, 0]);
var rune = contents [row, col, 0];
char [] spair;
if (Rune.DecodeSurrogatePair((uint) rune, out spair)) {
output.Append (spair);
} else {
output.Append ((char)rune);
}
contents [row, col, 2] = 0;
}
}

View File

@@ -97,7 +97,7 @@ namespace UICatalog.Scenarios {
label = new Label ("RadioGroup:") { X = Pos.X (label), Y = Pos.Bottom (listView) + 1 };
Win.Add (label);
var radioGroup = new RadioGroup (new ustring [] { "item #1", gitString, "Со_хранить" }, selected: 0) {
var radioGroup = new RadioGroup (new ustring [] { "item #1", gitString, "Со_хранить", "𝔽𝕆𝕆𝔹𝔸" }, selected: 0) {
X = 20,
Y = Pos.Y (label),
Width = Dim.Percent (60),