浏览代码

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

BDisp 4 年之前
父节点
当前提交
b56edacbac
共有 3 个文件被更改,包括 5 次插入4 次删除
  1. 2 0
      Example/demo.cs
  2. 1 4
      Terminal.Gui/Core/ConsoleDriver.cs
  3. 2 0
      UICatalog/UICatalog.cs

+ 2 - 0
Example/demo.cs

@@ -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 ();
 		}

+ 1 - 4
Terminal.Gui/Core/ConsoleDriver.cs

@@ -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>

+ 2 - 0
UICatalog/UICatalog.cs

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