This commit is contained in:
2024-11-18 16:28:45 +02:00
parent f0452ff9f7
commit 825c7e3391
34 changed files with 624 additions and 426 deletions

View File

@@ -4,6 +4,7 @@ import "testing"
// Make sure NULL bytes are removed
func TestEnsureValidUTF8(t *testing.T) {
t.Parallel()
// Create a string with a null byte
strWithNull := "Hello" + string('\x00') + "world"
result, _ := BytesToValidUTF8([]byte(strWithNull))