neuecc / Utf8Json

Definitely Fastest and Zero Allocation JSON Serializer for C#(NET, .NET Core, Unity, Xamarin).
MIT License
2.35k stars 266 forks source link

** Critical bug: Unicode Character doesn't serialize properly \u0003 #224

Open penguinawesome opened 4 years ago

penguinawesome commented 4 years ago

We have just found out that this end of text unicode character: \u0003 doesn't serialize properly in string causing the front end to crash and saying that the json is incorrect or in a malformed state (we are using the angularjs). I compare the values being serialize in newtonsoft versus utf8json and in newtonsoft, they serialize it as \u0003 not the string literal that is why its working.

Here is the output in utf8json (raw response):

image

And here is the output in newtonsoft (raw response):

image

penguinawesome commented 4 years ago

We are experiencing this issue in serializing the response from .net framework web api -> MediaTypeFormatter

image

st-gwerner commented 4 years ago

Does Pull Request #217 work for you? I had to implement a fix for this because of a similar issue. If you want to quickly test my fork on your code to see if it works for you, you can get it from https://github.com/st-gwerner/Utf8Json

If it works, I'd also strongly suggest merging it to this repo

penguinawesome commented 4 years ago

@st-gwerner hey thanks! Yea it works! Btw, when building your fork version to generate the Library DLL, do i need to set it to release mode? Do you have a plan on maintaining that fork version repo? I hope you could add them on nuget. It looks like the main author of this library is not active anymore and yes i highly suggest that this PR should be merged with this Main Repo.

Temtaime commented 4 years ago

@neuecc @neon-izm please, fix this issue, or i'd go with another library, nobody wants patching the library at their own and deploy it.