1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

clear out non-ascii chars from data

This commit is contained in:
Kelly Brazil
2019-10-25 09:53:44 -07:00
parent c8c5564b29
commit 4fa88c1ba3

View File

@ -19,7 +19,8 @@ $ history | jc --history -p
def parse(data): def parse(data):
output = {} output = {}
linedata = data.splitlines() # split lines and clear out any non-ascii chars
linedata = data.splitlines().encode('ascii', errors='ignore').decode()
# Clear any blank lines # Clear any blank lines
cleandata = list(filter(None, linedata)) cleandata = list(filter(None, linedata))