Page MenuHomePhabricator

Permalinks are getting very long when non-latin characters are part of the link
Open, Needs TriagePublic


By their structure, permalinks can be long: #c-<username1>-<timestamp1>-<username2>-<timestamp2>. They can be even longer if all comments are written using non-Latin characters.

One of the drawbacks is that the [perma]link is copied using link encoding, for example “The field appears: %D8%A7%D9%84%D9%85%D9%8A%D8%AF%D8%A7%D9%86” and this may make it difficult to deal with it as internal links. Unless the encoding is replaced via online tools «URL Decoder».

Permalink to this comment (a good example)

Event Timeline

Note that this is generally true of non-latin links in contexts where the %-encoded form is shown. Even without the permalink, the page link is:

I'm not sure there's much we can do about this, but it would be nice if more places used the original form, like one sees in the address bar:

image.png (35×770 px, 9 KB)

In contexts where a short link is required, the URL shortener can always be used, e.g.

Yeah, I suspected that we could not do much there. Perhaps adding a community configuration to generate short links as the default link?

The non-encoded form of these URLs is equally valid, for exampleويكيبيديا:الميدان/منوعات#c-Mohanad-20240130214100-وصلة_دائمة_لتعليقات_المستخدمين_المُلحقة_بط. It should be possible to use this form when we're copying the link upon clicking a timestamp.

(As far as I know, we can't control the browser behavior when copying from the address bar or (right click) → Copy link. Perhaps some day browser developers will consider non-English-speaking users. Firefox has an option for it – in about:config you can toggle browser.urlbar.decodeURLsOnCopy to true.)

(Firefox has an option for it – in about:config you can toggle browser.urlbar.decodeURLsOnCopy to true.)

Nice! Maybe this could documented somewhere so that at least Firefox users can copy readable links?

Maybe we could have two separate affordances?

  • The link in the timestamp is just a regular link, with no JavaScript added, i.e. no auto-copy. One can left-click on it and then copy the URL from the URL bar, or right-click on it and select Copy Link (or however it’s called in their browser). If they use Firefox and have browser.urlbar.decodeURLsOnCopy enabled, the former will result in a human-readable link, in other browsers and the latter won’t (but will be safe to post anywhere: other forums, URL shorteners etc.). We can’t do anything about this.
  • Another button in the three-dot menu added in T249893, called “Copy wikitext link”, copies a wikitext-formatted link to the clipboard, e.g. [[ويكيبيديا:الميدان/منوعات#c-Mohanad-20240130214100-وصلة دائمة لتعليقات المستخدمين المُلحقة بط]]. No percent-encoding, no underscores, no domain name, just what you would paste in a wikitext editor (or in a VisualEditor editor, as VE auto-converts this syntax to a link).