Having difficulty processing/deserializing incoming SQS Messages in .NET Core 2.1 that contain UTF-8
chars within Lambda function. Some nodes of the messages look like this, : {'documentLibraryName': {'tr_TR': 'Belge Kitapl\\xc4\\xb1\\xc4\\x9f\\xc4\\xb1', 'th_TH': '\\xe0\\xb9\\x84\\xe0\\xb8\\xa5\\xe0\\xb8\\x9a\\xe0\\xb8\\xa3\\xe0\\xb8\\xb2\\xe0\\xb8\\xa3\\xe0\\xb8\\xb5\\xe0\\xb9\\x80\\xe0\\xb8\\xad\\xe0\\xb8\\x81\\xe0\\xb8\\xaa\\xe0\\xb8\\xb2\\xe0\\xb8\\xa3', 'bg_BG': '\\xd0\\x91\\xd0\\xb8\\xd0\\xb1\\xd0\\xbb\\xd0\\xb8\\xd0\\xbe\\xd1\\x82\\xd0\\xb5\\xd0\\xba\\xd0\\xb0 \\xd0\\xbd\\xd0\\xb0 \\xd0\\xb4\\xd0\\xbe\\xd0\\xba\\xd1\\x83\\xd0\\xbc\\xd0\\xb5\\xd0\\xbd\\xd1\\x82\\xd0\\xb8'}}
Attempting to Deserialize this message string, using JSON.NET
like so
var result = JsonConvert.DeserializeObject(message);
is getting the following exception: Bad JSON escape sequence: \x. Path 'data.v2.documentLibraryName.tr_TR'
. Attempted to replace \\
with \\\\
but getting same result. How those UTF-8
characters above can be decoded so that message can be processed successfully, but preserve data?
Thank You!