using System;
using System.Text;
public static class ConsoleOutputTest {
public static void Main() {
Console.OutputEncoding = System.Text.Encoding.UTF8;
for (var i = 0; i <= 1000; i++) {
Console.Write(Strings.ChrW(i));
if (i % 50 == 0) { // break every 50 chars
Console.WriteLine();
}
}
Console.ReadKey();
}
}
VB.NET
imports Microsoft.VisualBasic
imports System
public module ConsoleOutputTest
Sub Main()
Console.OutputEncoding = System.Text.Encoding.UTF8
dim i as integer
for i = 0 to 1000
Console.Write(ChrW(i))
if i mod 50 = 0 'break every 50 chars
Console.WriteLine()
end if
next
Console.ReadKey()
End Sub
end module
也有可能您选择的控制台字体不支持该特定字符。点击 Windows 工具栏菜单(如 C: .)并选择属性-> 字体。试试其他字体,看看它们是否能正确地显示你的字符: