remove special chars...

This commit is contained in:
iceman1001 2021-10-10 15:33:23 +02:00
commit 67632fdc24
3 changed files with 298 additions and 267 deletions

View file

@ -4,6 +4,7 @@
import sys import sys
import pandas as pd import pandas as pd
import requests import requests
import re
ATR_URL = 'https://www.eftlab.co.uk/knowledge-base/171-atr-list-full/' ATR_URL = 'https://www.eftlab.co.uk/knowledge-base/171-atr-list-full/'
@ -15,18 +16,43 @@ def print_atr(df):
if type(a) is not str or type(b) is not str: if type(a) is not str or type(b) is not str:
continue continue
a = a.replace(' ','') a = a.replace(' ','')
a = a.replace('', '..')
if (len(a) == 0 or len(b) == 0): if (len(a) == 0 or len(b) == 0):
continue continue
b = b.replace('\\', '\\\\').replace('', '')
b = b.replace('\\', '\\\\')
b = b.replace('', '\'')
b = b.replace('', '\'')
b = b.replace('', '\'')
b = b.replace('', '\'')
b = b.replace('ó', 'o')
b = b.replace('ú', 'u')
b = b.replace('', '-')
b = b.replace('', '-')
b = b.replace('', '')
b = b.replace('Č', 'C')
b = b.replace('á', 'a')
b = b.replace('ř', 'r')
b = b.replace('ę', 'e')
b = b.replace('ł', 'l')
b = b.replace('İ', 'I')
b = b.replace('', '...')
#b = re.sub('[^A-Za-zs ]+', '', b)
print(f' {{ "{a}", "{b}" }},') print(f' {{ "{a}", "{b}" }},')
def main(): def main():
# making sure we print UTF-8
sys.stdout = open(1, 'w', encoding='utf-8', closefd=False)
r = requests.get(ATR_URL) r = requests.get(ATR_URL)
r.status_code r.status_code
list_atr = pd.read_html(r.text, header=0, keep_default_na=False) list_atr = pd.read_html(r.text, header=0, keep_default_na=False)

View file

@ -31,6 +31,11 @@ const char *getAtrInfo(const char *atr_str) {
return NULL; return NULL;
} }
// iceman: how do your loop handle these?
// +++++ +
// { "3BFF1100008171404200002101314252000[0,5]63........9000.*", "Smart Card 'The Smart Way to Login' Used on Acer TravelMate to secure boot" },
for (int j = 0; j < slen; j++) { for (int j = 0; j < slen; j++) {
tmp_atr[j] = AtrTable[i].bytes[j]=='.' ? '.' : atr_str[j]; tmp_atr[j] = AtrTable[i].bytes[j]=='.' ? '.' : atr_str[j];
} }

File diff suppressed because it is too large Load diff