sync with O'Reilly Atlas
This commit is contained in:
@@ -34,11 +34,11 @@ def main(args):
|
||||
print(count, 'characters shown')
|
||||
else:
|
||||
counts, firsts = category_stats()
|
||||
for cat, count in counts.most_common():
|
||||
for i, (cat, count) in enumerate(counts.most_common(), 1):
|
||||
first = firsts[cat]
|
||||
if cat == 'Cs':
|
||||
first = f'(surrogate U+{ord(first):04X})'
|
||||
print(f'{count:6} {cat} {first}')
|
||||
print(f'{i:2} {count:6} {cat} {first}')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
@@ -8,9 +8,9 @@ print('sys.stdout.encoding:', sys.stdout.encoding)
|
||||
print()
|
||||
|
||||
test_chars = [
|
||||
'\u2026', # HORIZONTAL ELLIPSIS (in cp1252)
|
||||
'\u221E', # INFINITY (in cp437)
|
||||
'\u32B7', # CIRCLED NUMBER FORTY TWO
|
||||
'\N{HORIZONTAL ELLIPSIS}', # exists in cp1252, not in cp437
|
||||
'\N{INFINITY}', # exists in cp437, not in cp1252
|
||||
'\N{CIRCLED NUMBER FORTY TWO}', # not in cp437 or in cp1252
|
||||
]
|
||||
|
||||
for char in test_chars:
|
||||
|
||||
Reference in New Issue
Block a user