dimkr / tootik

A federated nanoblogging service with a Gemini frontend.
gemini://hd.206267.xyz
Apache License 2.0
95 stars 3 forks source link

idn usernames #38

Closed norayr closed 6 months ago

norayr commented 6 months ago

do you think you'd like to support unicode usernames?

mastodon and socialhome do not allow to register unicode usernames. but i looked in the activity pub spec and didn't find there a limitation. i think unicode usernames are permitted by the spec.

the other question would be - if mastodon would receive updates from such a user.

dimkr commented 6 months ago

do you think you'd like to support unicode usernames?

Have you tried this? tootik just takes username from CN (in client cert) or asks you for input if username is already taken - AFAIK in both cases it's a UTF-8 string.

(I'm not sure if Mastodon et al allow non-ASCII characters in usernames, aka the preferredUsername field - they certainly allow them in the name field but tootik doesn't have it)

EDIT: looks like Mastodon allows only English letters and numbers in usernames, https://github.com/mastodon/mastodon/blob/10203bd57a13b243b03491f107efbe9566e89ed6/app/models/account.rb#L68

norayr commented 6 months ago

i tried it long ago, and tried it again now.

if i write something in armenian letters i get: աբգդե is invalid, enter username.

(just edited this post to give you an example to try)

looks like Mastodon allows only English letters and numbers in usernames

in their usernames i already noticed.

i hope mastodon will be able to receive publications from other activity pub servers that allow unicode usernames.

dimkr commented 6 months ago

Currently, tootik doesn't have a name property for users, only preferredUsername, and it's limited to a-z0-9 (for compatibility with Mastodon).

This issue will become relevant if and when tootik gains a name property, which is supposed to be a human-readable display name or the actual name of a person.

norayr commented 6 months ago

still, if you don't want to allow unicode usernames - that's ok, and your decision.

my understanding is that mastodon doesn't allow registrations of unicode usernames. but you have the opportunity to test, if mastodon will allow receiving messages from unicode usernames.

xmpp/jabber implementations allow unicode usernames, also for social media publishing via xmpp (there is such rfc). and they also implement activity pub gateway, so unicode usernames will come to fediverse sooner or later.

dimkr commented 6 months ago

I don't think it's a good idea because non-Unicode characters in usernames (as opposed to names) will break the regular expressions used to detect things like mentions. If and when Mastodon allows this - I'll consider doing this in tootik too.