tidwall / sjson

Set JSON values very quickly in Go
MIT License
2.4k stars 165 forks source link

cannot replace when processing special character "₫" #85

Open JackTJC opened 2 months ago

JackTJC commented 2 months ago

here I have a price field to modify, and i wanna use both of Optimistic and ReplaceInPlace option because the path is very simple and i wanna a better performance, but the bellowing code doesn't works well

set, err := sjson.SetOptions(`{"test":"149.000₫"}`, "test", "255.000₫", &sjson.Options{
    Optimistic:     true,
    ReplaceInPlace: true,
})
fmt.Println(set) // output: {"test":"149.000₫"}, actually no change

above code change nothing in json and doesn't return the errNoChange