From 564f7cfbf638c3779692e1a8e630f116eb7ef775 Mon Sep 17 00:00:00 2001 From: Salvatore Bonaccorso Date: Fri, 28 Apr 2023 23:02:42 +0200 Subject: process-cve-records: Workaround descriptions with non-ascii characters This restores previous storing of the truncated descriptions in our CVE list files until we know we can handle all non-ascii characters. Particular care might be needed on webservice side. Signed-off-by: Salvatore Bonaccorso --- bin/process-cve-records | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/process-cve-records b/bin/process-cve-records index 7892819706..9f30c7fcf9 100755 --- a/bin/process-cve-records +++ b/bin/process-cve-records @@ -73,7 +73,9 @@ def parse_record(record, cve): desc = desc.replace('\n', ' ') # and even non-printable characters such as \xa0 ( ) - desc = "".join([ c for c in desc if c.isprintable() ]) + # if a character is non-ascii then return character in + # ASCII-only representation. + desc = "".join([ c if ord(c) < 128 else ascii(c).strip('\'') for c in desc if c.isprintable() ]) # and some contain leading spaces desc = desc.strip() -- cgit v1.2.3