dotnet-opa-wasm icon indicating copy to clipboard operation
dotnet-opa-wasm copied to clipboard

fix: parsing failed if json data contains unicode

Open nigma143 opened this issue 1 year ago • 4 comments

nigma143 avatar Nov 05 '23 19:11 nigma143

#52

nigma143 avatar Nov 05 '23 19:11 nigma143

@christophwille алё!

nigma143 avatar Nov 15 '23 07:11 nigma143

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)

christophwille avatar Jan 04 '24 12:01 christophwille

https://www.openpolicyagent.org/docs/latest/wasm/ image

Current impl is not correct image

nigma143 avatar Jan 09 '24 09:01 nigma143

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)

christophwille avatar Mar 17 '24 13:03 christophwille