Page MenuHomePhabricator

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

Description

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) https://ar.wikipedia.org/wiki/%D9%88%D9%8A%D9%83%D9%8A%D8%A8%D9%8A%D8%AF%D9%8A%D8%A7:%D8%A7%D9%84%D9%85%D9%8A%D8%AF%D8%A7%D9%86/%D9%85%D9%86%D9%88%D8%B9%D8%A7%D8%AA#c-Mohanad-20240130214100-%D9%88%D8%B5%D9%84%D8%A9_%D8%AF%D8%A7%D8%A6%D9%85%D8%A9_%D9%84%D8%AA%D8%B9%D9%84%D9%8A%D9%82%D8%A7%D8%AA_%D8%A7%D9%84%D9%85%D8%B3%D8%AA%D8%AE%D8%AF%D9%85%D9%8A%D9%86_%D8%A7%D9%84%D9%85%D9%8F%D9%84%D8%AD%D9%82%D8%A9_%D8%A8%D8%B7

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:

https://ar.wikipedia.org/wiki/%D9%88%D9%8A%D9%83%D9%8A%D8%A8%D9%8A%D8%AF%D9%8A%D8%A7:%D8%A7%D9%84%D9%85%D9%8A%D8%AF%D8%A7%D9%86/%D9%85%D9%86%D9%88%D8%B9%D8%A7%D8%AA

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. https://w.wiki/97Sc

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 https://ar.wikipedia.org/wiki/ويكيبيديا:الميدان/منوعات#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).