Better unicode conversion
This commit is contained in:
@@ -6,7 +6,7 @@ import "testing"
|
||||
func TestEnsureValidUTF8(t *testing.T) {
|
||||
// Create a string with a null byte
|
||||
strWithNull := "Hello" + string('\x00') + "world"
|
||||
result, _ := EnsureValidUTF8([]byte(strWithNull))
|
||||
result, _ := BytesToValidUTF8([]byte(strWithNull))
|
||||
if result != "Helloworld" {
|
||||
t.Errorf("Expected string without NULL byte, got %s", result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user