Live data from Hacker News

Charset="WTF-8"

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

51–60 of 463 posts

Re: Charset="WTF-8"

#51
post #20

Earlier quoted context omitted.

name.Length > 0 is probably pretty safe.

See point 40 and 32-36 on Falsehoods programmers believe about names[1] [1] https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...

I know that this is trying to be helpful but the snark in this list detracts from the problem.

Re: Charset="WTF-8"

#52
post #3
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.

Is name validation even possible?

Don't validate names, use transliteration to make them safe for postal services (or whatever). In SQL this is COLLATE, in the command line you can use uconv:

>echo "'Lódź'" | uconv -f "UTF-8" -t "UTF-8" -x "Latin-ASCII"

>'Lodz'

Re: Charset="WTF-8"

#53
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…

There’s this individual’s name which involves a clock sound: Nǃxau ǂToma[1]

[1] https://en.m.wikipedia.org/wiki/N%25C7%2583xau_%C7%82Toma

Re: Charset="WTF-8"

#54

Earlier quoted context omitted.

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, "鈴木涼太".

That's part of {Alphabetic} in Unicode. It validates.

Re: Charset="WTF-8"

#55
post #26

Earlier quoted context omitted.

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…

> I'm curious if anyone can think of any other non-alphabetic characters used in legal names around the world, in other scripts? Latin characters are NOT allowed in official names for Japanese citizens. It must be written in Japanese characters only. For foreigners living in Japan it's quite frequent to end up in a situation where their official name in Latin does not pass the validation rules of many forms online. I…

Very interesting about Japan!

To be clear, I wasn't thinking about within a specific country though.

More like, what is the set of all characters that are allowed in legal names across the world?

You know, to eliminate things like emoji, mathematical symbols, and so forth.

Re: Charset="WTF-8"

#56
post #3

Earlier quoted context omitted.

Is name validation even possible?

Presumably there aren't any people with control characters in their name, for example.

คุณ สมชาย

This name, "คุณสมชาย" (Khun Somchai, a common Thai name), appears normal but has a Zero Width Space (U+200B) between "คุณ" (Khun, a title like Mr./Ms.) and "สมชาย" (Somchai, a given name).

In scripts like Thai, Chinese, and Arabic, where words are written without spaces, invisible characters can be inserted to signal word boundaries or provide a hint to text processing systems.

Re: Charset="WTF-8"

#57

A system not supporting non-latin characters in personal names is pitiful, but a system telling the user that they have an invalid name is outright insulting.

[deleted]

Re: Charset="WTF-8"

#58
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…

דויד Smith (concatenated) will have an LTR control character in the middle

Re: Charset="WTF-8"

#59
post #3

Earlier quoted context omitted.

Is name validation even possible?

Presumably there aren't any people with control characters in their name, for example.

Or unpaired surrogates. Or unassigned code points. Or fullwidth characters. Or "mathematical bold" characters. Though the latter two should be probably solved with NFKC normalization instead.

Re: Charset="WTF-8"

#60

Earlier quoted context omitted.

Presumably there aren't any people with control characters in their name, for example.

คุณ สมชาย This name, "คุณสมชาย" (Khun Somchai, a common Thai name), appears normal but has a Zero Width Space (U+200B) between "คุณ" (Khun, a title like Mr./Ms.) and "สมชาย" (Somchai, a given name). In scripts like Thai, Chinese, and Arabic, where words are written without spaces, invisible characters can be inserted to signal word boundaries or provide a hint to text processing systems.

But C0 and C1 control codes are out, probably.
Post reply on HN