From 82906e8bb4ad8b545ae3cd84aa95838a89af175b Mon Sep 17 00:00:00 2001 From: raylu Date: Fri, 19 Aug 2016 17:41:19 -0700 Subject: [PATCH] don't print control chars --- unicode | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/unicode b/unicode index c6bfcd2..088846a 100755 --- a/unicode +++ b/unicode @@ -632,10 +632,16 @@ def print_characters(clist, maxcount, format_string, query_wikipedia=0, query_wi except UnicodeError: in_additional_charset = "NONE" - if properties['combining']: - pchar = " "+c + category = properties['category'] + category_desc = general_category[category] + if category == 'Cc': # control character + pchar = '' else: - pchar = c + if properties['combining']: + pchar = " "+c + else: + pchar = c + uppercase = properties['uppercase'] lowercase = properties['lowercase'] opt_uppercase = opt_lowercase = '' @@ -648,8 +654,6 @@ def print_characters(clist, maxcount, format_string, query_wikipedia=0, query_wi ord_lowercase = ord(properties['lowercase']) opt_lowercase = '\n{green}Lowercase:{default} {ord_lowercase:04X}'.format(**locals()) flipcase = lowercase - category = properties['category'] - category_desc = general_category[category] opt_numeric = '' numeric_desc = ''