Skip to content

Conversation

@neilalexander
Copy link
Contributor

The Matrix specification says everything should be UTF-8:

For the default HTTP transport, all API calls use a Content-Type of application/json. In addition, all strings MUST be encoded as UTF-8.

... and our handling of UTF-16 surrogates was quite broken here, which sometimes resulted in broken JSON after CompactJSON.

The Matrix specification says everything should be UTF-8:

> For the default HTTP transport, all API calls use a Content-Type of application/json. In addition, all strings MUST be encoded as UTF-8.

... and our handling of UTF-16 surrogates was quite broken here, which sometimes resulted in broken JSON after `CompactJSON`.
@neilalexander neilalexander requested a review from kegsay May 26, 2022 10:35
@neilalexander neilalexander merged commit b1c5619 into main May 26, 2022
@neilalexander neilalexander deleted the neilalexander/removeutf16 branch May 26, 2022 10:52
neilalexander added a commit to matrix-org/dendrite that referenced this pull request May 26, 2022
neilalexander added a commit that referenced this pull request Aug 30, 2022
This somewhat reverts #314 and refactors things so that the broken JSON that could happen before with faulty surrogates will no longer happen.
neilalexander added a commit that referenced this pull request Aug 30, 2022
This somewhat reverts #314 and refactors things so that the broken JSON that could happen before with faulty surrogates will no longer happen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants