Internationalise The Fediverse


We live in the future now. It is OK to use Unicode everywhere.

It seems bizarre to me that modern Internet services sometimes "forget" that there's a world outside the Anglosphere. Some people have the temerity to speak foreign languages! And some of those languages have accents on their letters!! Even worse, some don't use English letters at all!!!

A decade ago, I was miffed that GitHub only supported some ASCII characters in its project names. There's no technical reason why your repo can't be called "ഹലോ വേൾഡ്".

Similarly, I'm frustrated that Mastodon (the largest ActivityPub service) doesn't allow Unicode usernames and has resisted efforts to change.

So I built a small ActivityPub server which publishes content from an Actor called @你好@i18n.viii.fi - it is only a demo account, but it works!

Some ActivityPub clients report that they are able to follow it and receive messages from it. Others - like Mastodon - simply can't see anything from it. Take a look at the replies on Mastodon to see which services work. You can also see some of its posts on the Fediverse.

What Does The Fox Spec Say?

The ActivityPub specification says:

Building an international base of users is important in a federated network. Internationalization

I can't find anything in the specifications which limits what languages a username can be written in. But there are a few clues scattered about.

The user's @ name is defined by preferredUsername which is:

A short username which may be used to refer to the actor, with no uniqueness guarantees. 4.1 Actor objects

There's nothing in there about what scripts it can contain. However, later on, the spec says:

Properties containing natural language values, such as name, preferredUsername, or summary, make use of natural language support defined in ActivityStreams. 4. Actors

So it is expected that a preferred username could be written in multiple scripts. Which implies that the default need not be limited to A-Z0-9.

The ActivityStreams specification talks about language mapping.

Finally, the ActivityPub specification has some examples on non-Latin text in names.

So, I think that it is acceptable for usernames to be written in a variety of non-Latin scripts.

But What About...?

There are usually a few objections to "Unicode Everywhere" zealots like me. I'd like to forestall any arguments.

What about homograph attacks?

Well, what about them? ASCII has plenty of similar looking characters. I doubt most people would notice when a capital i is replaced by a lower L - and vice-versa. Similarly the kerning issue of an r and n looking like an m is well known. Are mixed language homographs more dangerous? I don't think so.

What if people make names that can't be typed?

Well, what if they do? Maybe not being found by people who can't type your language is a feature, not a bug. But, anyway, clients can let users search for other people, or copy and paste their names.

What about weird "Zalgo" text?

It is up to a client to decide how they want to render text input. The "problems" of strange Unicode combinations are well known. This is not a hard computer-science problem.

What about bi-directional text?

The spec makes clear this is allowed.

Do people even want a username in their own script?

I have no evidence for this. But I bet you'd get pretty frustrated if you had to switch keyboard just to type your own name, wouldn't you? In any case, why can't I have a username of @😉

What's Next?

If you build ActivityPub software, give some thought to the billions of people who don't have names which easily fit into ASCII.

If your software can see @你好@i18n.viii.fi and its posts, please let me know.


Share this post on…

  • Mastodon
  • Facebook
  • LinkedIn
  • BlueSky
  • Threads
  • Reddit
  • HackerNews
  • Lobsters
  • WhatsApp
  • Telegram

35 thoughts on “Internationalise The Fediverse”

  1. @blog Yes! English may have an elevated status in software development, but that should absolutely not translate into any kind of favouritism on the user side. I don’t have enough insight into the technical side of international username support to say if there might be issues you haven’t addressed, but I know that custom emoji gets the ASCII treatment as well, and for no good reason whatsoever. :gutkato_malĝojeta:

    #Mastodon and #Firefish have these issues open for the emoji:

    Unicode in custom emoji for MastodonUnicode in custom emoji for FirefishUnicode in custom emoji reactions for Pleroma

    #Pleroma has basic support the emoji, but lacks support for post language. There are two pull requests to add it, but their importance seems severely underestimated:

    Setting post language in PleromaMulti-language posting in Pleroma

    Might be a good idea to have open issues and track their status in all the relevant software. It also probably helps if more people talk about this and express support (in appropriate channels!) to show that yes, it is indeed worth it. :sandviĉo:

    | Reply to original comment on jam.xwx.moe
  2. said on social.vivaldi.net:

    @Edent I agree on the issue of homograph attacks - this is bad when you might be communicating/logging in/paying online and you want to make sure you send data to the right place. There, the domain is all you really have to go from and it needs be to be absolutely right, especially when clicking links.
    But when it's social media, what's the worst that could happen if you follow olly instead of oIIy?
    If there is a vital security issue, punycoded domains names while leaving unicode account names seems like a reasonable compromise (that's why thinks like mastodon domain verification exists).

    On the issue of emoji account names though, emoji is an absolute mess and I hate all of it. But you do you. 😤

    Reply | Reply to original comment on social.vivaldi.net
  3. said on toot.me.uk:

    @Edent unless I have missed something, it is a shame we don’t have a newer ctype.h that can take a char* and isalpha a utf8. You need a similarly low level (that I end up writing myself every time) next char function and so on.

    Now tell me I have missed a universal utf8.h that has existed for decades?!?!

    My guess though is nothing as light weight as ctype.h though, sadly.

    Personally I would mostly be happy to consider anything >= 0x80 as an ongoing identifier character.

    Reply | Reply to original comment on toot.me.uk
  4. @blog I have no problem with something like original ASCII for localized English-speaking application or database use. For anything general, or applicable internationally or even worldwide I see no excuse for anything less when we have something suitable for generating bad translations into almost every language! I see no excuse for making anyone code or script in a language foreign to them. This is 2024, we have international solutions for this!

    | Reply to original comment on techhub.social
  5. @blog "This is not a hard computer-science problem."

    😂

    There is, or at least was for decades, a Cambridge computer science exam question: "Explain why even experienced programmers sometimes have difficulties with character codes."

    When that question was originally written the expected answers would have been around things like escape sequences on five track paper tape.

    When I did the exam the sort of answer expected might have been to do with whether your code was portable between ASCII and EBCDIC (with the gaps in the middle of the letters, remember?).

    These days, your toot would be an answer.

    | Reply to original comment on c.im
  6. @blog i’m not a fan of this idea tbh solely because of accessibility - not everything supports copypasting fedi handles and there is a reason why most communities demand at least a portion of alphanumeric characters for usernames

    BTW before you yell at me; i’m not part of the "anglosphere" and to be frank as someone who’s one of these native speakers of "language with accented letters" this is more useless than a blue checkmark emoji and only brings more issues than the positives

    (also lol saying the latin script is "english alphabet" ggwp that’s a nice self own)

    | Reply to original comment on wavebird.party
    1. says:

      @onemuri @blog
      Thanks for your repy. Re your comment about a "self own".

      The purpose of hyperbole in written text is to convey the ridiculous nature of a statement by making it obviously extreme. For example, I used multiple exclamation marks and preceded it with a couple of other statements of a similar nature.

      In doing so, I hoped to lead my reader into understanding that I disagreed with the proposition - as set out by the rest of the post.

      I'm sorry if that wasn't clear.

      | Reply to original comment on mastodon.social
  7. says:

    @blog hmph.

    Clicking on it just goes to the webfinger URL.

    Searching for the @-form shows nothing.

    Searching by URL gives:

    timestamp="2024-02-26T17:53:27.591Z" func=server.glob..func1.Logger.func13.1 level=ERROR latency="59.686515ms" userAgent="…" method=GET statusCode=500 path=/api/v2/search clientIP=… errors="Error #01: Get: error searching by URI: byURI: error looking up https://i18n.viii.fi/%E4%BD%A0%E5%A5%BD as account: enrichAccount: error webfingering remote account 你好@i18n.viii.fi: fingerRemoteAccount: error extracting subject parts for @你好@i18n.viii.fi: couldn't match namestring @%E4%BD%A0%E5%A5%BD@i18n.viii.fi\n" requestID=xfdrssmd04001gtxd8yg msg="Internal Server Error: wrote 54B"
    

    (this is GotoSocial main as of yesterday or so)

    Personally, I’ve got mixed feelings on this one.

    I agree that the localpart should be able to contain Unicode codepoints. Some should be excluded. I don’t know the exact set offhand, but those allowed in URLs (after the server and /, i.e. in the path component) should probably be fine.

    The domain part, however, I’m rather firm on it not deviating from ASCII, i.e. to internationalise it the punycode representation (xn--something) must be used, not the Unicode representation.

    So, no complaint against @☻@example.com but I consider @foo@example.ею invalid because it needs to be spelt @foo@example.xn--e1a4c instead. (What clients make of this is up to them, as usual with IDNs… sigh)

    | Reply to original comment on toot.mirbsd.org

Trackbacks and Pingbacks

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.

Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <p> <pre> <br> <img src="" alt="" title="" srcset="">