It's infuriating, I've seriously considered changing my name because of it.
It's infuriating, I've seriously considered changing my name because of it.
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.
It's like those infuriating bank / other websites that truncate passwords on login forms but not on the password change form.
On the plus side, you have a strong privacy guarantee :)
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.
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.
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.
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.or...).
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#Homograph...
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.
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).