Fixes #225 and maybe #41. Allowing Rune.ColumnWidth greater than one.

This commit is contained in:
BDisp
2020-10-16 17:08:57 +01:00
parent 31b76df893
commit b56edacbac
3 changed files with 5 additions and 4 deletions

View File

@@ -549,6 +549,8 @@ static class Demo {
public static Action running = MainApp;
static void Main ()
{
Console.OutputEncoding = System.Text.Encoding.Default;
while (running != null) {
running.Invoke ();
}

View File

@@ -571,14 +571,11 @@ namespace Terminal.Gui {
} else if (c >= 0x80 && c <= 0x9F) {
// C1 control characters (https://www.aivosto.com/articles/control-characters.html#c1)
return new Rune (0x25a1); // U+25A1, WHITE SQUARE, □:
} else if (Rune.ColumnWidth (c) > 1) {
// BUGBUG: Until we figure out how to fix #41. Note this still doesn't help when
// an Emoji or other char doesn't represent it's width correctly
return new Rune (0x25a1); // U+25A1, WHITE SQUARE, □:
} else {
return c;
}
}
/// <summary>
/// Adds the specified
/// </summary>

View File

@@ -64,6 +64,8 @@ namespace UICatalog {
static void Main (string [] args)
{
Console.OutputEncoding = Encoding.Default;
if (Debugger.IsAttached)
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo ("en-US");