Hello,
as my title says: on Windows 10, my console (cmd prompt) does not display Chinese input string by Console.ReadLine (but it displays Chinese non-input strings correctly).
Here is my problematic code-chunk:
The output in console (cmd prompt) looks like this:
As you can see, between 你好 and !there are three whitespaces. I have specified the encoding for console input, therefore I do not understand why the input string is not displayed correctly.
Thanks in advance for Your help!
Cheers XD
as my title says: on Windows 10, my console (cmd prompt) does not display Chinese input string by Console.ReadLine (but it displays Chinese non-input strings correctly).
Here is my problematic code-chunk:
C#:
using System;
using System.IO;
using System.Text;
namespace 字符
{
class Program
{
static void Main(string[] args)
{
Console.InputEncoding = Encoding.UTF8;
string Name = "字符人";
int Age;
Age = 1;
Console.WriteLine("你好!我是一个"+ Name + "。");
Console.WriteLine("我现在" + Age + "岁了。");
Console.WriteLine("这是现在的我:");
Console.WriteLine(" ---------");
Console.WriteLine("| | |");
Console.WriteLine("|----+----|");
Console.WriteLine("| | |");
Console.WriteLine(" ---------");
string Nameuser, Name1, 颜色, 高度, 兴趣爱好, 性格特点;
Console.Write("你叫什么名字:");
Nameuser = Console.ReadLine();
Console.WriteLine("你好,"+ Nameuser + "!");
(etc.)
The output in console (cmd prompt) looks like this:
C#:
你好!我是一个字符人。
我现在1岁了。
这是现在的我:
---------
| | |
|----+----|
| | |
---------
你叫什么名字:王先生
你好, !
你也帮我取个名字:
Thanks in advance for Your help!
Cheers XD
Last edited by a moderator: