This is for handling facebook webhooks.
An event string arrives like this
{"object":"page","entry":[{"id":"222222222","time":1536713510549,"messaging":[{"sender":{"id":"1111111111"},"recipient":{"id":"355433484576638"},"timestamp":1536713509901,"message":{"mid":"VnOoUhb2FUTyfnkXtmKgqDCfJlgJPB_n1gj-8aC6ka4-Oo2GjMXS82vHH9ChydJrPX_5Zu3sJ6skCv8JToF1IA","seq":206765,"text":"Jeg m\u00e5 bare si at jeg elsker Obosbladet! St\u00e5 p\u00e5 videre! \ud83d\ude00\ud83d\ude2c\ud83d\ude01\ud83d\ude02\ud83d\ude03\ud83d\ude04"}}]}]}
This is deserialized using
Dim TestObj As RealTimeEvent = JsonConvert.DeserializeObject(Of RealTimeEvent)(eventStr)
At this point , if I view the TestObj message in the debugger , I see
"Jeg må bare si at jeg elsker Obosbladet! Stå på videre! "
Note the Swedish characters have been handled correctly, but the java escaped emoticon is not.(\ud83d\ude00\ud83d\ude2c\ud83d\ude01\ud83d\ude02\ud83d\ude03\ud83d\ude04)
If I then try to deserialize the object
JsonConvert.SerializeObject(TestObj )
I get
{""RawEvent"":"""",""object"":""page"",""entry"":[{""id"":""355433484576638"",""time"":""1536713510549"",""changes"":null,""messaging"":[{""optin"":null,""read"":null,""postback"":null,""sender"":{""id"":""975511412531391""},""recipient"":{""id"":""355433484576638""},""timestamp"":""1536713509901"",""message"":{""mid"":""VnOoUhb2FUTyfnkXtmKgqDCfJlgJPB_n1gj-8aC6ka4-Oo2GjMXS82vHH9ChydJrPX_5Zu3sJ6skCv8JToF1IA"",""seq"":""206765"",""text"":""Jeg må bare si at jeg elsker Obosbladet! Stå på videre! "",""attachments"":null}}]}]}
The Swedish characters are converted.. which is what I want, but I have no chance of handling the emoticon
Is there anyway I preserve everything that is not understood by the Newtonsoft De serializing process but keep the conversion of Swedish and other characters?
---Edit-- Adding explanation of what I am trying to achieve--- I need to be able to access the original definition of the emoticon.."\ud83d\ude00\ud83d\ude2c\ud83d\ude01\ud83d\ude02\ud83d\ude03\ud83d\ude04" I am integrating to another system that can not handle emoticons at all. I have written a 'translator' which will parse the message text looking for the java escaped data. I take the whole emoticon definition (all pairs) and reduce until I find a matching definition. Perhaps there is a way to tell the serializer to not convert any escaped values and keep the message text 'raw'? ( I have tried various JsonSerializerSettings but not found any)