4 ms·
Working with internationalized URLs (IRIs) is a Cursed Problem. Here is the IRI for the Wikipedia page on semiconductors. When you click on it, it should show
by klodolph 6y ago
Working with internationalized URLs (IRIs) is a Cursed Problem.
Here is the IRI for the Wikipedia page on semiconductors. When you click on it, it should show you a page with a picture of a silicon wafer on the left.
https://ar.wikipedia.org/wiki/شبه_موصل https://ar.wikipedia.org/wiki/شبه_موصل
Now try copy/pasting that link text into different web apps and see how they respond. HN seems to handle it correctly. Twitter doesn’t, it considers شبه_موصل to be just some extra text after the URL.
- toast0 6y agoThat's really a problem of picking up a url/uri/iri in text without delimeters. You see the same thing when there's 'uncommon' ascii characters in urls, like a trailing period, or commas or exclamation points. The proper thing to do is to enclose links in <>, as was done in well-formed email, but that wasn't super consistent either, and it hasn't transitioned to the world conciousness.
- klodolph 6y agoI don’t want to rely on users figuring out how to use delimiters. If the URIs with trailing periods break, so be it, people can use <>, but don’t make people use <> just because the URL isn’t English.
- kevsim 6y agoSo I just tried pasting this into the editor for the issue tracker I work on [0]. When I traverse the URL from left to right with the keyboard cursor it goes as "normal" up to the the last / then jumps to the end, then traverses "backwards" then jumps back to the end. Is this right or do we have a bug? Mixing LTR and RTL is super confusing. Does recognize it as a link just fine though. 0: https://kitemaker.co https://kitemaker.co
- sangnoir 6y agoThat sounds correct to me, but there's no canonical answer. The question is, do you want to change keyboard cursor context from "next character" mid-sentence from LTR to RTL? If you do that, the cursor will get "stuck" at the word boundary where next and previous mean the same thing (left is both "prev" for LTR and "next" for RTL - how should the computer interpret that?)