Filter unicode characters
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
package com.vitorpamplona.quartz.nip19Bech32
|
||||
|
||||
import com.vitorpamplona.quartz.nip01Core.tags.addressables.ATag
|
||||
import com.vitorpamplona.quartz.nip19Bech32.bech32.bechToBytes
|
||||
import com.vitorpamplona.quartz.nip19Bech32.entities.NAddress
|
||||
import com.vitorpamplona.quartz.nip19Bech32.entities.NEvent
|
||||
import com.vitorpamplona.quartz.nip19Bech32.entities.NProfile
|
||||
@@ -428,4 +429,15 @@ class NIP19ParserTest {
|
||||
nevent,
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun decodeBech32WithInvisibleCharacter() {
|
||||
val bomChar = '\uFEFF'
|
||||
val withBom = bomChar + "nsec1lfkarc7439n4l3uahr45ej8mrjc39dd879t0ps355550dj8j9uzs3rnw24"
|
||||
|
||||
assertEquals(
|
||||
"nsec1lfkarc7439n4l3uahr45ej8mrjc39dd879t0ps355550dj8j9uzs3rnw24",
|
||||
withBom.bechToBytes().toNsec(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user