Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user display names of up to 64 bytes. #981

Merged
merged 1 commit into from
Mar 15, 2023
Merged

Conversation

ianmacd
Copy link

@ianmacd ianmacd commented Sep 27, 2022

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

  • My contribution is fully baked and ready to be merged as is
  • I ensure that all the open issues my contribution fixes are mentioned in the commit message of my first commit using the Fixes #1234 syntax

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.
@hjubb
Copy link

hjubb commented Sep 28, 2022

This looks good to me, I'll try to get this merged after double checking the limit isn't hard-coded anywhere else in the app like receiving config messages or anything like that but should be pretty quick to merge 👍

Thanks for the PR!

@hjubb hjubb changed the base branch from master to dev March 15, 2023 23:38
@hjubb hjubb merged commit 405b8c7 into oxen-io:dev Mar 15, 2023
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