Skip to content

Conversation

@nickvergessen
Copy link
Member

Backport of #575

json_encode is messing with multibyte characters a lot,
replacing them with something along "\u1234" instead of the assumed 2-times overhead.
The data length in our encryption is a hard limit, but we don't want to
make non-utf8 subjects unnecessary short. So this function tries to cut
it off first.
If that is not enough it always cuts off 5 characters in multibyte-safe
fashion until the json_encode-d string is shorter then the given limit.

Signed-off-by: Joas Schilling <coding@schilljs.com>
@rullzer rullzer merged commit b14f094 into stable16 Mar 7, 2020
@rullzer rullzer deleted the backport/575/stable16 branch March 7, 2020 14:28
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.

3 participants