Live data from Hacker News

Charset="WTF-8"

wtf-8.xn--stpie-k0a81a.com

31–40 of 463 posts

Re: Charset="WTF-8"

#31
post #3

Earlier quoted context omitted.

Is name validation even possible?

If you just use the {Alphabetic} Unicode character class (100K code points), together with a space, hyphen, and maybe comma, that might get you close. It includes diacritics. I'm curious if anyone can think of any other non-alphabetic characters used in legal names around the world, in other scripts? I wondered about numbers, but the most famous example of that has been overturned: "Originally named X Æ A-12, the chi…

What if one's name is not in alphabetic script? Let's say, "鈴木涼太".

Re: Charset="WTF-8"

#32
post #20

Earlier quoted context omitted.

name.Length > 0 is probably pretty safe.

That only works if you’re concatenating the first and last name fields. Some people have no last name and thus would fail this validation if the system had fields for first and last name.

some people have no name at all

Re: Charset="WTF-8"

#33
post #18

How do I allow "stępień" while detecting Zalgo-isms?

Zalgo is largely the result of abusing combining modifiers. Declare that any string with more than n combining modifiers in a row is invalid.

n=1 is probably a reasonable falsehood to believe about names until someone points out that language X regularly has multiple combining modifiers in a row, at which point you can bump up N to somewhere around the maximum number of combining modifiers language X is likely to have, add a special case to say "this is probably language X so we don't look for Zalgos", or just give up and put some Zalgo in your test corpus, start looking for places where it breaks things, and fix whatever breaks in a way that isn't funny.

Re: Charset="WTF-8"

#34
post #18

How do I allow "stępień" while detecting Zalgo-isms?

For the unaware (including myself): https://en.wikipedia.org/wiki/Zalgo_text

If you really think you need to programmatically detect and reject these (I'm dubious), there is probably a reasonable limit on the number of diacritics per character.

https://stackoverflow.com/a/11983435

Re: Charset="WTF-8"

#35
post #2

A coworker once implemented a name validation regex that would reject his own name. It still mystifies me how much convincing it took to get him to make it less strict.

I know multiple developers who would just say "well it's their fault, they have to change name then".

Re: Charset="WTF-8"

#36

Earlier quoted context omitted.

That only works if you’re concatenating the first and last name fields. Some people have no last name and thus would fail this validation if the system had fields for first and last name.

some people have no name at all

Any notable examples apart from young children and Michael Scott that one time?

Re: Charset="WTF-8"

#38
post #22
post #3

Earlier quoted context omitted.

Is name validation even possible?

It is if you first provide a complete specification of a “name”. Then you can validate if a name is compliant with your specification.

Valid names are those which terminate when run as Python programs.
Post reply on HN