douglasg14b / BetterConsoleTables

Faster, colorable, more configurable, and more robust console colors & tables for C# console applications
GNU Lesser General Public License v3.0
92 stars 16 forks source link

Issue with Unicode support? #34

Closed Miho1254 closed 11 months ago

Miho1254 commented 1 year ago
            var table = new Table("Họ tên", "Tuổi", "Giới tính", "Chi phí đồng phục");
            foreach (Student student in students)
            {
                double uniformCost = student.CalculateUniformCost();
                string gender = (student is Female_Student) ? "Nữ" : "Nam";
                table.AddRow(student.name, student.age, gender, uniformCost);
            }
            table.Config = TableConfiguration.Unicode();
            Console.WriteLine(table.ToString());

image

IDK if this is bug of old windows console or your libary have issue with Unicode intergration

douglasg14b commented 1 year ago

Can you explain what the expected behavior vs the behavior your seeing is? The table looks proper to me 🤔

Can you also provide a repro that I am able to execute?

Miho1254 commented 1 year ago

Can you explain what the expected behavior vs the behavior your seeing is? The table looks proper to me 🤔

Can you also provide a repro that I am able to execute?

Sorry for make u become confusing,

the "ng?c" shoud be "ngọc" but it doesn't

I don't know this bug is from Windows 10 Terminal or the Libary but the column header is perfectly compatible with the Unicode

douglasg14b commented 1 year ago

Gotcha, this likely isn't the library since the library doesn't manipulate the input characters themselves. It just prints it out to console.

You could always try printing out to console directly when making the table to see what the output is inside your loop. This could be as simple as an input problem.

image

douglasg14b commented 11 months ago

Closing as no response.

Miho1254 commented 6 months ago

Fixed with

            Console.OutputEncoding = Encoding.Unicode;
            Console.InputEncoding = Encoding.Unicode;