3 ms·
I have an Irish O' surname, and I've been to too many conferences where it's been changed to O%apos; on my nametag, and in once case a registration failed becau
by tapoxi 4y ago
I have an Irish O' surname, and I've been to too many conferences where it's been changed to O%apos; on my nametag, and in once case a registration failed because there is a second unicode apostrophe that some text editors use which means my name won't match what's in their database. Not to mention many sites consider it an illegal character and drop the apostrophe all together.
It's infuriating, I've seriously considered changing my name because of it.
- sacrosancty 4y agoImagine if even strongly typed languages had different string types for various encodings like that and enforced them. Then such bugs would be as rare as, say, a date appearing as a huge integer.
- rhn_mk1 4y agoWhen Python did that to separate raw bytes and proper Unicode, people pointed this out as a reason they don't want to use the language any more.
- sacrosancty 4y agoSounds like Python wasn't right for those people in the first place. Abstracting away the internal data format is typical of Python.
- Thorrez 4y agohttps://angular.io/api/platform-browser/SafeHtml https://angular.io/api/platform-browser/SafeHtml https://google.github.io/closure-library/api/goog.html.SafeHtml.html https://google.github.io/closure-library/api/goog.html.SafeH...
- Cu3PO42 4y agoTo a degree, Rust does this. The standard string type is always guaranteed to be valid UTF-8. Then there's a string type for the OS native format and a string type for what constitutes a valid path on the file system. Of course, arrays of bytes also exist and so does a type for a null-terminated "CString". Converting between them requires runtime checks (unless you invoke unsafe code and promise you know better than the compiler). It's cumbersome at times, but a perfectly reasonable tradeoff in my opinion. Some libraries add other string types when they're needed to interact with a system. For example, the windows crate has wide strings.
- notacoward 4y agoThere was a research C compiler, maybe related to the meta-compilation effort that became Coverity, that did something like this. It let you attach arbitrary attributes to a variable and then enforce invariants regarding those attributes. The one that caught my eye was tagging checked vs. unchecked user input, so that using such input before checking (or sanitizing) would become a type error. It's a shame that the idea didn't catch on more.
- mejutoco 4y agoThis is a good idea I believe. While I agree it would be convenient to have it in the standard library of more languages, it can be implemented in strongly typed languages, using something like Newtype in haskell. In Typescript, for example, it could be: type SanitizedString = string And somewhere you have a function getSanitizedString and if you don't call that the type system will complain. Same could be done to represent a distance in Km or miles: type DistanceKm = number type DistanceMiles = number And then functions can explicitly use any of them or only some (we could define some function multiplying them to allow 2 arguments only if they are the same type).
- johnorourke 4y agoYep... post arrives to "O'Rourke", websites tell me "your name is invalid", checkouts tell me my details are incorrect so I can't pay. And not just small sites - I've seen it on banks, large retailers, companies who should know better. Sometimes it's due to a legacy back-end system dating back to the 1990's or earlier, so they have to strip out "bad" characters before sending the order or contact form through.
- mjevans 4y agoThis wouldn't be nearly as much of an issue if the validation were consistent... It's like those infuriating bank / other websites that truncate passwords on login forms but not on the password change form.
- mellavora 4y agoaproppos "Hello, I'm Mr. Null. My Name Makes Me Invisible to Computers" https://www.wired.com/2015/11/null/ https://www.wired.com/2015/11/null/ On the plus side, you have a strong privacy guarantee :)
- belter 4y agoIt could be also, like X Æ A-12, or any of the following real names of real persons: Ben Dover, Hashtag Follow, Destinee Hooker, Khumalo Tiny Dick, Guy Nutter Guilherme Crabogiale Fuck, Jurassic Park, Beautiful Existence, Tokyo Sexwale, Mike Litoris, Batman Bin Suparman, Jesus Condom Mrs. Rape, Kash Register, Donald Duck, Robert Fagot, Tatiana Vagina, Hitler Mussolini.
- wtetzner 4y agoThat's so weird to me. It means that somewhere someone is matching the string "null" and converting it into an actual null value.
- remexre 4y agoIt's pretty believable to me that _some_ Java deserialization library from the early oughts totally does this as a default behavior.
- DangitBobby 4y agoI suspect some batch processing job with a CSV dump is the culprit behind a lot of bad treatment of strings.
- jsmith45 4y agoWhat is generally happening in these cases is that data is getting stringified, with `null` becoming the string "null" (which is a common output for string formatting a null in various languages). This output is is then later re-parsed, and to try to restore null inputs back to being null, the code matches on the string "null", ignoring the fact that that could have been a valid string itself.
- GoblinSlayer 4y ago
- nebul 4y agoMy first name contains an accented e, and what the computer will spit out is a crapshoot: é, e, é, é or just a plain blank square. It makes me want to buy an internationalised domain name out of spite.
- jeroenhd 4y agoInternationalised domain names will display fine because they are punycode that browsers and other clients happen to render as internationalised domains. E-mail is even worse than web applications at this because even common and popular mail clients can't do UTF-8 in email addresses right (https://www.google.com/search?q="SMTPUTF8"+site%3Adovecot.org https://www.google.com/search?q="SMTPUTF8"+site%3Adovecot.or...).
- nebul 4y agoIn my experience Punycode support in browsers varies greatly depending on the phishing[1] mitigations in place, making them quite unreliable in practice unfortunately. I'm pleasantly surprised about SMTPUTF8 being a thing though. Yeah nobody uses it, but I thought email had zero UTF-8 support so it's at least better than nothing, I guess. [1] https://en.wikipedia.org/wiki/IDN_homograph_attack#Homographs_in_internationalized_domain_names https://en.wikipedia.org/wiki/IDN_homograph_attack#Homograph...
- GoblinSlayer 4y agoSMTPUTF8 is about unicode email addresses. I think, UTF-8 messages have wide support.
- nebul 4y agoSorry, I was indeed talking about Unicode email addresses but I worded it poorly. Thanks for the precision!
- raverbashing 4y agoIt's frankly infuriating how names with apostrophes were considered "invalid" even in systems designed for the US population (including a great number of Irish immigrants - ah but blame them for having "funny names" - that are even full ASCII)
- lovehashbrowns 4y agoMy name has a dash “-“ due to the way my foreign birth certificate is written. I’m sure it’s not as annoying as an apostrophe, but goodness is it frustrating sometimes. For example, some hotels use lastname+room number for the wifi password. I never know if my last name has the dash or not. Sometimes it doesn’t work at all, so I’m not sure if the dash is being replaced by another character. Then there’s the problem of forms that don’t allow dashes in the last name field. Doesn’t sound like a problem until I’m filling out a form that’s meant to be legally binding in some way.
- bloak 4y agoAs I understand it, in the original Irish there's no apostophe and the apostrophe was added by English speakers because of a mistaken idea that it's short for "of the", as in "five o'clock". Of course, a lot of names are also spelt differently in Irish: O'Rourke = Ó Ruairc O'Reilly = Ó Raghallaigh O'Donovan = Ó Donnabháin So you could get rid of the apostrophe and at the same time really spice your name up, perhaps.
- lamontcg 4y agoThey'll get a middle initial of "O" probably due to that space character, and similar issues in matching their last name.
- yongjik 4y agoThere's also a famous Dutch physicist, Gerard 't Hooft, whose family name is "'t Hooft", including the initial(!!) apostrophe. Imagine that.