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:
@ -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))
|
||||||
|
Reference in New Issue
Block a user