8 ms·
Once again, programmers forget alphabets other than the Latin one exist. And by Latin, I mean the one containing only A through Z, with no “fancies”. Then ther
by colejohnson66 4y ago
Once again, programmers forget alphabets other than the Latin one exist. And by Latin, I mean the one containing only A through Z, with no “fancies”.
Then there’s the issue of character encodings, which the article does a decent job explaining! Nitpick though: they claims it’s a UTF-8/ASCII thing, but it’s actually a UTF-8/Windows-1252 issue.
In related news, even GNU coreutils fails to support UTF-8 properly despite a claim of support for multibyte character sets: https://catgirl.ai/log/cut-c-harmful/ https://catgirl.ai/log/cut-c-harmful/
- mc32 4y agoI want URLs that handle spaces. Like I could enter www.coca cola.com. [and not www.coca-cola.com. nor www.cocacola.com.) and it would work. "Simple space". Even the Latin/Roman alpha had space(s).
- teeray 4y agowww.google.com [a ton of spaces that HN won’t let me type] jknotgoogle.com
- mc32 4y agoI just want a single contiguous space character so I don't have to suppress the space or substitute with an alternate character --also URL boxes can make it conspicuously obvious for better UI. And while they're at it, allow & (ampersand).
- andrewxhonson 4y agoMaybe the location bar should accept the space but strip it? That would work for input if not reading the URL. Maybe only allowing single consecutive spaces to avoid the address spoofing example. I could go for that. I would love & natively though. For my wedding (bride&groom.com for example) I looked into faking it with punycode but nothing was close enough, and anything other than an ampersand would have been too hard to input.
- armchairhacker 4y agogood think hyperlinks are typically underlined so there will be a large training line at the end
- astine 4y agoUnless someone turns off the underlining with a stylesheet.
- thatguy0900 4y agoGoogle search urls are typically long enough that they are shortened by ... At least on mobile
- notamy 4y agoDomain registration already has a lot of rules around length, what characters can be where in the domain name (ex. no hyphens as the very first/last characters), ... I'm sure it'd be trivial to have a "no-repeating-spaces" rule or similar.
- karatinversion 4y agogoogle.com [spaces] pwned.evilcorp.com it is
- gumby 4y agoSpace is perfectly legal in URLs, but not in a domain name so your example won’t work for that reason.
- ly3xqhl8g9 4y agoThe Romans wrotewithoutspaces as in "continuous script" [1], however they·did·use·the·interpunct for delineation on inscriptions. In order to have spaces in domain names we would need to use another sign, such as • [2], to separate words and avoid ambiguity. [1] https://en.wikipedia.org/wiki/Scriptio_continua https://en.wikipedia.org/wiki/Scriptio_continua [2] The bullet • (U+2022) alt code is 7, or Opt + 8 on Mac. The interpunct · (U+00B7) alt code is 250, or Shift + Opt + 9 on Mac. Rather inconvenient for the regular user.
- OJFord 4y agoIs that ever ambiguous in Latin, or is there enough variation in declensions and conjugations (and enough of them) that the word endings are always clear?
- ly3xqhl8g9 4y agoQuote from Wikipedia: 'For example, a phrase written in scriptio continua as collectamexiliopubem may be interpreted as collectam ex Ilio pubem, meaning "a people gathered from Troy", or collectam exilio pubem, "a people gathered for exile". Thus, readers had to be much more cognisant of the context to which the text referred.' As in everything, context rules over content.
- mminer237 4y agoYou can have spaces in URLs: https://matthewminer.name/spaced%20name https://matthewminer.name/spaced%20name You just can't have them in domain names.
- mc32 4y agoSure, I meant the whole URL, including the domain portion as in my example.
- cxr 4y ago> Like I could enter www.coca cola.com. [and not www.coca-cola.com Aside from all the comments about what's wrong with this on a technical level, this is a poor example since the product name is actually "Coca-Cola" and not "Coca Cola".
- ranger_danger 4y agoMost of us realize that other encodings and alphabets exist, it's just that supporting them is a nightmare. Do you have any idea how many un-typeable, invisible Unicode control characters there are? Did you know you can display the same Unicode text using different byte combinations? How on Earth are devs supposed to sanitize this??
- cxr 4y agoThis comment is taking on flak, but Wirth &co took a similar stance, even as Zürchers.
- IshKebab 4y agoI definitely agree. The article even mentions someone with a diaeresis in their name, which is distinct from an umlaut. Good luck sorting that mess out. That said, you could clearly whitelist a much more reasonable range of characters than just the Latin alphabet. Hypens, apostrophes, common accented letters etc. should probably all be allowed. There are standard algorithms for canonicalising the unicode representation of them.
- GoblinSlayer 4y agoIt's inert text, query parameters will sanitize it for you.
- JTbane 4y agoIt's only inert if you're not transforming it (for example, calling toLower on all strings passed in) or doing equality checks. Many applications use these and it is a minefield in Unicode.
- tialaramex 4y agoBut what's the semantic purpose of these operations? Linguistically these are very strange things to do to arbitrary text, and yet because in ASCII it was easy, programmers got into the habit of just doing it all over the place without thinking about what (if anything) it meant. For transform operations like "toLower" often it turns out that to the extent it means anything it's only relevant to ASCII and so an operation which only transforms ASCII is appropriate anyway.
- rsynnott 4y ago> but it’s actually a UTF-8/Windows-1252 issue. Or possibly ISO-8859-1, which is, helpfully, slightly different.
- colejohnson66 4y agoTrue. But, in this case, I'm betting it's Windows-1252. The character in Ch'ien's name is most likely `U+2099 RIGHT SINGLE QUOTATION MARK`. In UTF-8, that's `E2 80 99`. ISO-8859-1 doesn't have 80 or 99 defined, but Windows-1252 would decode it to ’ (what's on the card).