From 767343f7b53079118d62507a9549a8b17b72cbbd Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Tue, 9 May 2023 13:01:58 +0300 Subject: Replace chars not allowed in RDF * dump.scm (sanitize-rdf-string): New function Signed-off-by: Munyoki Kilyungi --- dump.scm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dump.scm b/dump.scm index eca54cd..835a199 100755 --- a/dump.scm +++ b/dump.scm @@ -135,6 +135,14 @@ association list mapping substrings to their replacements." str replacement-alist)) +(define (sanitize-rdf-string str) + (replace-substrings + (string-trim-both str) + '(("\r" . "\\r") + ("\n" . "\\n") + ("\"" . "'") + ("\v" . "")))) + (define (snake->lower-camel str) (let ((char-list (string->list str))) (call-with-output-string -- cgit v1.2.3