minhhungit / ConsoleTableExt

A fluent library to print out a nicely formatted table in a console application C#
MIT License
323 stars 36 forks source link

#32 fix the bug If multiple rows of data contain UTF8 character #33

Closed haptear closed 2 years ago

minhhungit commented 2 years ago

Can you please check why these rows are skewed

image

haptear commented 2 years ago

@minhhungit Because there are UTF8 characters, the output of Console is correct

image

minhhungit commented 2 years ago

I actually also worry about the problem when user just want to show table as text, for example they put the table into an email. Is there a way we can handle both cases @haptear

Anyway, thanks for the PR

minhhungit commented 2 years ago

Do you think we should have a toogle to turn on/off it

haptear commented 2 years ago

yes a toogle switch to print to console or print to file

minhhungit commented 2 years ago

@haptear it will be great if you can implement that feature please, I will merge this PR after that.

I'm sorry I'm quite busy these days so I greatly appreciate your help. Many thanks

haptear commented 2 years ago

@minhhungit ok i will finish the feature

haptear commented 2 years ago

@minhhungit
I have tested the whole thing and it's not a code problem, it's a font selection problem. If you set a monospaced font, the display format is correct. not monospaced font UTF8 character and Uppercase character will cause the display format is not correct.

font with 'Arial' image

font with 'Consolas' the monospaced font image

font with 'Arial' have Uppercase character image

font with 'Consolas' have Uppercase character image

haptear commented 2 years ago

My VS environment font is not set to 'Consolas', the format is correct; image

minhhungit commented 2 years ago

So do we still need a toggle to turn on/off utf8/unicode mode @haptear ?

haptear commented 2 years ago

Not anymore

If anyone need to send emails, please use the HTML template to send. The formatting is correct, because HTML is monospaced font by default.

minhhungit commented 2 years ago

thanks @haptear