Fix event encoding issue

This commit is contained in:
William Casarin
2023-02-06 11:10:23 -08:00
parent 140b0e4fc4
commit eae844e081
3 changed files with 5 additions and 4 deletions

View File

@@ -370,6 +370,7 @@ func decode_nostr_event(txt: String) -> NostrResponse? {
func encode_json<T: Encodable>(_ val: T) -> String? {
let encoder = JSONEncoder()
encoder.outputFormatting = .withoutEscapingSlashes
return (try? encoder.encode(val)).map { String(decoding: $0, as: UTF8.self) }
}