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 usernames with non-English characters #2140

Open
bunnybot opened this issue Sep 9, 2019 · 10 comments
Open

Allow usernames with non-English characters #2140

bunnybot opened this issue Sep 9, 2019 · 10 comments
Labels
enhancement New feature or request internationalization Translation system, string fixes, RTL support

Comments

@bunnybot
Copy link

bunnybot commented Sep 9, 2019

We currently only allow a subset of ASCII in usernames. It would be nice if speakers of languages other than English were more free in their choice, e.g. allow them to add äßé or a Username in Cyrillic or Chinese script.

See also the website bug 1784693 "Using Unicode literals cause a server error"


Imported from Launchpad using lp2gh.

@bunnybot bunnybot added internationalization Translation system, string fixes, RTL support New labels Sep 9, 2019
@bunnybot
Copy link
Author

bunnybot commented Sep 9, 2019

(by franku)
This is a restriction of Django in combination python2:

"... Unicode characters have always been accepted when using Python 3. Django 1.10 officially added Unicode support in usernames, keeping the ASCII-only behavior on Python 2."

See: https://docs.djangoproject.com/en/1.11/ref/contrib/auth/#django.contrib.auth.models.User.username

So the switch to python 3 will accept a wide range of additional characters. Tested 'ß' in usernames, also polish characters in the python3 branch.

But we need to change the database encoding to fully support unicode (e.g. chinese characters), which means the length of text columns shrinks and thus there is a possibility to loose some of text in old entries. So this has to be done carefully.

@bunnybot
Copy link
Author

bunnybot commented Sep 9, 2019

(by stonerl)
Before we can enable this on the website, we need to make sure widelands can properly handle this.

Here is a list of things to do first:

  • proper username parsing (e.g. spaces in names)
  • autocomplete usernames on tab in chats
  • proper chinese/japanese/korean etc input
    (at least japanese is broken)

We must be sure that usernames are accessible by others; for wispering, warning & kicking. Otherwise, a user could just choose a name that other can't type and non of the above mentioned would be possible.

That's why I'm currently limiting the possible characters for usernames in widelands.

Enabling this will be much work. We should also make sure that we do not enable support for this on the website without having the code in widelands in place.

@bunnybot
Copy link
Author

bunnybot commented Sep 9, 2019

(by franku)

  • proper username parsing (e.g. spaces in names)

FYI: django's default is to permit spaces in usernames.

@bunnybot
Copy link
Author

bunnybot commented Sep 9, 2019

(by franku)
Sorry: djangos default is to forbid spaces in usernames

@bunnybot
Copy link
Author

bunnybot commented Sep 9, 2019

(by stonerl)
Well, then we can add one checkmark to the list :)

@bunnybot
Copy link
Author

bunnybot commented Sep 9, 2019

(by gunchleoc)
I am in favor of reworking the chat UI so that player can click on a user in a list of usernames to add their name to the chat. That would also solve the problem of accidentally posting publicly instead of whispering when you mistype a username.

It would also be really cool if we had a team chat in-game.

So, start this project with a redesign of the chat UI?

@bunnybot
Copy link
Author

bunnybot commented Sep 9, 2019

(by stonerl)

So, start this project with a redesign of the chat UI?

I guess... :)

@bunnybot
Copy link
Author

bunnybot commented Sep 9, 2019

(by gunchleoc)
Issue moved to widelands/widelands-website#300

@gunchleoc gunchleoc added enhancement New feature or request and removed Wishlist labels Sep 13, 2019
@gunchleoc gunchleoc added this to Needs triage in Issue triage Sep 13, 2019
@gunchleoc
Copy link
Contributor

@frankystone Could our Django handle this now? I don't expect this to happen for Build 21, but it would be nice to know.

@gunchleoc gunchleoc moved this from To Do to Under Discussion in Issue triage Sep 28, 2019
@gunchleoc gunchleoc moved this from Under Discussion to Needs Information in Issue triage Sep 28, 2019
@frankystone
Copy link
Contributor

Django should be able to handle this. The problem is the Database encoding.

The Database uses the encoding utf8 (mysql specific), which stores up to 3 bytes for a character. To support all possible unicode code points, we have to convert the columns in the database to use the encoding utf8mb4 (mysql specific), which uses up to 4 bytes for a character.

Characters which uses more than 3 bytes are all below the Basic Multilingual Plane ('0 BMP'), see https://en.wikipedia.org/wiki/Unicode_block. These are e.g. emojis and Caucasian Albanian. May some diacritical signs uses also more than 4 bytes.

@gunchleoc gunchleoc removed this from Needs Information in Issue triage Sep 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internationalization Translation system, string fixes, RTL support
Projects
None yet
Development

No branches or pull requests

3 participants