Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Unicode characters should be escape when serializing messages.

Open
#1,188 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
csharp
Domain
database

Research direction

Start at src/DurableTask.Core/Serializing/JsonDataConverter.cs around line 38 and inspect the JsonSerializerSettings used by the constructor. Confirm how Unicode message values are serialized and how the result is stored in the Microsoft.DurableTask.SqlServer Payloads varchar(max) field. Done means non-ASCII characters are escaped during serialization so they are not corrupted in the database.

Written by the indexing model from the issue text.

Description

https://github.com/Azure/durabletask/blob/3bc255cb4df1565e5ac760ebd1dc040f58f02e5e/src/DurableTask.Core/Serializing/JsonDataConverter.cs#L38

Add StringEscapeHandling = StringEscapeHandling.EscapeNonAscii into JsonSerializerSettings.

public JsonDataConverter()
	: this(new JsonSerializerSettings
	{
		TypeNameHandling = TypeNameHandling.Objects,
		DateParseHandling = DateParseHandling.None,
		StringEscapeHandling = StringEscapeHandling.EscapeNonAscii,
	#if NETSTANDARD2_0
		SerializationBinder = new PackageUpgradeSerializationBinder()
	#else
		Binder = new PackageUpgradeSerializationBinder()
	#endif
	})
{ }

When using the Microsoft.DurableTask.SqlServer package, the Payloads field's datatype is varchar(max).
When the database defaults to English, so varchar will not be saved correctly when inserting Unicode characters.

Example:

SELECT [Text],[Reason]  FROM [dt].[Payloads]

[{"$type":"xxx","Name":"????2024?4??????.md","BookId":"6b88bc7a-9c5f-7a83-2003-e935bb5b33a8","BookName":"????2024?4??????.md"}]
Dominant language
C#
Stars
1.7k
Forks
335
Avg merge
5d 3h
Merged PRs (30d)
8

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Azure/durabletask

All issues in Azure/durabletask

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.