dotnet-opa-wasm
dotnet-opa-wasm copied to clipboard
fix: parsing failed if json data contains unicode
#52
@christophwille алё!
https://github.com/open-policy-agent/npm-opa-wasm/blob/39950c934a9b739f86aabc9215d7c05809aa0443/src/opa.js#L37
https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder "The TextEncoder() constructor returns a newly created TextEncoder object that will generate a byte stream with UTF-8 encoding."
ok, UTF-8 is what is used by the default JS impl (text to utf8 bytes)
https://www.openpolicyagent.org/docs/latest/wasm/
Current impl is not correct
https://github.com/christophwille/dotnet-opa-wasm/commit/8a25d4da423f11132808ba41bbe82c188b2d7691
I have made a few more changes (to make FastEvaluate work properly), but in general I went with your fix. Thanks! (and sorry it took so long to get around to this)