Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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"


Hm, but I won't know if the text/terminal is utf8 or not going in.


Right... 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 :)


...interesting




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: