You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This prevents the JSON from being parsed as such by Newtonsoft.JSON library or anything else.
To Reproduce
using YamlDotNet.Serialization;varyamlObject=new Deserializer().Deserialize("test:\n - sea life \U0001F99E");varserializer=new SerializerBuilder().JsonCompatible().Build();
Console.WriteLine(serializer.Serialize(yamlObject));
Actual:
{"test": ["sea life \U0001F99E"]}
Expected:
{"test": ["sea life \u0001\uF99E"]}
The text was updated successfully, but these errors were encountered:
I’d have to check the yaml spec for utf 32, if there even is a spec for utf32. but that would probably be a simple change for serialiazing. Not sure about deserializing though. We do accept pr’s so if you want to submit one with applicable tests then I would be happy to merge it in. I was hoping to get a new version out last week but didn’t so I’m hoping for this weekend.
Describe the bug
When using JSON-compatible serializer (
new SerializerBuilder().JsonCompatible()
), it produces\Uxxxxxxxx
for UTF-32 special characters (https://github.com/aaubry/YamlDotNet/blob/master/YamlDotNet/Core/Emitter.cs#L1192-L1193), which seems to be against the JSON spec, which expects two 2-byte code points instead:\uxxxx\uxxxx
(also note lower-caseu
).This prevents the JSON from being parsed as such by Newtonsoft.JSON library or anything else.
To Reproduce
Actual:
Expected:
The text was updated successfully, but these errors were encountered: