diff options
author | Munyoki Kilyungi | 2023-05-22 11:10:06 +0300 |
---|---|---|
committer | BonfaceKilz | 2023-05-26 08:40:22 +0300 |
commit | a2a7002f629c57447b6099ac7385c5335e947e7f (patch) | |
tree | 082e67b55c4fa2e2f62f3001a3a1da5c9feab7e2 /examples/dump-dataset-metadata.scm | |
parent | 15efa0808f50a0e321ff1bbd1a800f937b8a18b2 (diff) | |
download | gn-transform-databases-a2a7002f629c57447b6099ac7385c5335e947e7f.tar.gz |
Fix broken utf-8 chars when dumping an investigator's names
* examples/dump-dataset-metadata.scm (dump-investigators) <foaf:name,
foaf:givenName>: Binary convert fields first to latin1 then utf8.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
Diffstat (limited to 'examples/dump-dataset-metadata.scm')
-rwxr-xr-x | examples/dump-dataset-metadata.scm | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/examples/dump-dataset-metadata.scm b/examples/dump-dataset-metadata.scm index 154f147..4747700 100755 --- a/examples/dump-dataset-metadata.scm +++ b/examples/dump-dataset-metadata.scm @@ -64,18 +64,14 @@ (field Investigators LastName) (field Investigators Email)) (set rdf:type 'foaf:Person) - ;; Special case Yohan Bossé's name since the last name has - ;; unprintable characters. (set foaf:name (string-append (field Investigators FirstName) " " (if (string=? (field Investigators FirstName) "Yohan") "Bossé" (field Investigators LastName)))) - (set foaf:givenName (field Investigators FirstName)) - ;; Special case Yohan Bossé's name since the last name has - ;; unprintable characters. - (set foaf:familyName (if (string=? (field Investigators FirstName) "Yohan") - "Bossé" - (field Investigators LastName))) + (set foaf:givenName + (field ("CAST(CONVERT(BINARY CONVERT(FirstName USING latin1) USING utf8) AS VARCHAR(100))" FirstName))) + (set foaf:familyName + (field ("CAST(CONVERT(BINARY CONVERT(LastName USING latin1) USING utf8) AS VARCHAR(100))" LastName))) (set foaf:homepage (field Investigators Url)) (set gn:address (field Investigators Address)) (set gn:city (field Investigators City)) |