Print Command Output preserving special

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2409
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Print Command Output preserving special

Post by evstevemd »

Does wxWidgets have any widget that can take command output from wxExecute and display it preserving non ASCII characters (like √) and color? I need to print output of command and it prints different colors for different message. I just don't have enough time to make yet another virtual terminal emulator :) . Only I need to display color and those characters.

If there is any cross platform third-party library I will also appreciate a link to it.
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Print Command Output preserving special

Post by doublemax »

As for the non-ascii characters, wxWidgets can display them, the problem is probably the character encoding of the console output. Once you know that (which is probably platform dependent) it should be easy to convert it to Unicode.

Regarding the color, you will need some kind of terminal emulator for that, depending on how the color information is encoded. But as you've already written one, can't you extract that part?
Use the source, Luke!
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2409
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: Print Command Output preserving special

Post by evstevemd »

doublemax wrote: Mon Jul 15, 2019 12:58 pm As for the non-ascii characters, wxWidgets can display them, the problem is probably the character encoding of the console output. Once you know that (which is probably platform dependent) it should be easy to convert it to Unicode.
Knowing encoding I think might be one of most difficult for me. I will try . Checking This link here looks like Most Linux Distros I will eye at use utf-8 already. Am not sure about Windows. I tried to investigate Mac is using utf-8 for both Terminal and iTerm2. I will try to find info about Windows terminal as well as power shell
doublemax wrote: Mon Jul 15, 2019 12:58 pmRegarding the color, you will need some kind of terminal emulator for that, depending on how the color information is encoded. But as you've already written one, can't you extract that part?
Seems like I need to drop this part. I don't have power or will to invest on this one. There is terminalwx
but am not sure if it can directly intepret colors from terminal output. I will investigate after solving the first
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
User avatar
doublemax
Moderator
Moderator
Posts: 19159
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Print Command Output preserving special

Post by doublemax »

http://ascii-table.com/ansi-escape-sequences.php
https://askubuntu.com/questions/558280/ ... f-terminal

Parsing the color shouldn't be too hard, but emulating the cursor movement might be tricky.
Use the source, Luke!
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2409
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania

Re: Print Command Output preserving special

Post by evstevemd »

Thanks for the link. Very useful indeed.
I will have to tackle the two first, one bit at a time. I'll see where I will end
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
Post Reply