Allow user display names of up to 64 bytes. #981
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, only 26 bytes are allowed for the user's display name. Whilst this is typically enough for users in the West, it is woefully inadequate for names natively rendered in non-Latin scripts.
Farsi, for example, uses double-byte characters, so 26 bytes can accommodate a maximum of just 13 characters.
The situation is worse yet for Japanese, Korean, Chinese and Thai, each of which uses triple-byte characters for a maximum of just 8 characters.
This patch increases the maximum size of the display name to 64 bytes, good for a minimum of 21 graphemes in even a triple-byte UTF-8 script.
64 bytes also happens to be the maximum length of an ONS registration for Session, and it seems entirely reasonable to allow users to have their ONS name as their display name.
See also #2514 for the equivalent fix for the desktop client.
Contributor checklist
Fixes #1234
syntax