[PATCH] cli: Fix non-printable character handling