fix ascii codes

This commit is contained in:
Q
2021-10-30 11:27:14 +03:00
parent 533a663eaf
commit 5e77691e7e

View File

@@ -1,7 +1,10 @@
#!/usr/bin/env python3
import sys, os
sys.path.append(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"..", "py-packages", "markslider", "markslider"
))
import ansicodes
from argparse import ArgumentParser
@@ -42,8 +45,13 @@ if __name__ == "__main__":
table = [[] for x in range(8)]
for c in range(0, 256):
col = int(c / 32)
try:
table[col].append(
(c, chr(c))
(c, chr(c).encode('latin1').decode(opts.cs))
)
except UnicodeDecodeError:
table[col].append(
(c, " ")
)
# sys.stdout.write(chr(c).decode('latin1'))
# remove control chars