4 ms·
With UTF-8 you need to UTF-8 encode the 9b. For example this shows red on xfce4-terminal in UTF-8 mode: printf "\xc2\x9b31mHi\e[0m\n"
by caf 6y ago
With UTF-8 you need to UTF-8 encode the 9b.
For example this shows red on xfce4-terminal in UTF-8 mode:
printf "\xc2\x9b31mHi\e[0m\n"
- ryan-c 6y ago...interesting
- lunixbochs 6y agoHm, but I won't know if the text/terminal is utf8 or not going in.
- caf 6y agoRight... and you have the Windows-1252 versus iso-8859-1 situation, which only differ in that the former puts printable characters where the latter has C1 control codes. Of course your code is a library so you have the library author's prerogative to punt that problem to the users :)