sbradshaw wrote: Mon Feb 03, 2025 12:28 pm
munaish wrote: Mon Feb 03, 2025 10:14 amensure usernames have to be ASCII-only
This would significantly limit use outside of English-speaking countries.
I don't know any stock international keyboards that cannot type A-Z, a-z, and 0-9, which are all represented in the ASCII character set. Even Japanese and Chinese keyboards can type them, as far as I understand. So, even though they couldn't type hanzi, kanji, accents, Cyrillic, and stuff, they could still type a username (just like they can type American website URLs).
You don't actually have to be dealing with ASCII itself anyway. You can limit it to whatever Unicode characters you want (without changing character sets).
It's not really about ASCII. It's about avoiding spoofing (and one way to avoid spoofing is by avoiding visually redundant characters). Avoiding non-ASCII characters is simply one way to avoid the most problematic kinds of spoofing. There are other ways to approach it. Yes, you can still spoof with ASCII, but it's easy to identify if you pay attention (and if you know it's ASCII, you know which characters are problematic). But ASCII can still be tricky with mixed casing; so, you might want to limit it to lowercase usernames for that reason (since with mixed casing you have Il1 and O0 can look pretty much the same, depending on the font, but in lowercase you have il1 and o0, which are easier to tell apart). I and l are the worst offenders in ASCII. So, you could enforce a serif font in usernames, if you wanted to keep mixed casing.
The problem with allowing the full range of Unicode in usernames (and I am
only talking about in usernames, and only in the context at hand) is Unicode encompasses all of these, which look pretty similar to each other:
Standard alphabet characters (found in ASCII):
• abcdefghijklmnopqrstuvwxyz
• ABCDEFGHIJKLMNOPQRSTUVWXYZ
Unicode characters (not found in ASCII):
Serif
• 𝐴𝐵𝐶𝐷𝐸𝐹𝐺𝐻𝐼𝐽𝐾𝐿𝑀𝑁𝑂𝑃𝑄𝑅𝑆𝑇𝑈𝑉𝑊𝑋𝑌𝑍 (mathematical italic capital)
• 𝑎𝑏𝑐𝑑𝑒𝑓𝑔ℎ𝑖𝑗𝑘𝑙𝑚𝑛𝑜𝑝𝑞𝑟𝑠𝑡𝑢𝑣𝑤𝑥𝑦𝑧 (mathematical italic small; the h isn't serif with one of the fonts I use)
• 𝑨𝑩𝑪𝑫𝑬𝑭𝑮𝑯𝑰𝑱𝑲𝑳𝑴𝑵𝑶𝑷𝑸𝑹𝑺𝑻𝑼𝑽𝑾𝑿𝒀𝒁 (mathematical bold italic capital)
• 𝒂𝒃𝒄𝒅𝒆𝒇𝒈𝒉𝒊𝒋𝒌𝒍𝒎𝒏𝒐𝒑𝒒𝒓𝒔𝒕𝒖𝒗𝒘𝒙𝒚𝒛 (mathematical bold italic small)
Sans serif
• 𝐀𝐁𝐂𝐃𝐄𝐅𝐆𝐇𝐈𝐉𝐊𝐋𝐌𝐍𝐎𝐏𝐐𝐑𝐒𝐓𝐔𝐕𝐖𝐗𝐘𝐙 (mathematical bold capital)
• 𝐚𝐛𝐜𝐝𝐞𝐟𝐠𝐡𝐢𝐣𝐤𝐥𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐭𝐮𝐯𝐰𝐱𝐲𝐳 (mathematical bold small)
• 𝘈𝘉𝘊𝘋𝘌𝘍𝘎𝘏𝘐𝘑𝘒𝘓𝘔𝘕𝘖𝘗𝘘𝘙𝘚𝘛𝘜𝘝𝘞𝘟𝘠𝘡 (mathematical sans-serif italic capital)
• 𝘢𝘣𝘤𝘥𝘦𝘧𝘨𝘩𝘪𝘫𝘬𝘭𝘮𝘯𝘰𝘱𝘲𝘳𝘴𝘵𝘶𝘷𝘸𝘹𝘺𝘻 (mathematical sans-serif italic small)
• 𝘼𝘽𝘾𝘿𝙀𝙁𝙂𝙃𝙄𝙅𝙆𝙇𝙈𝙉𝙊𝙋𝙌𝙍𝙎𝙏𝙐𝙑𝙒𝙓𝙔𝙕 (mathematical sans-serif bold italic capital)
• 𝙖𝙗𝙘𝙙𝙚𝙛𝙜𝙝𝙞𝙟𝙠𝙡𝙢𝙣𝙤𝙥𝙦𝙧𝙨𝙩𝙪𝙫𝙬𝙭𝙮𝙯 (mathematical sans-serif bold italic small)
There are a bunch more.
On top of that, there are many other redundant characters, even if they don't constitute whole alphabets like the ones I mentioned above do.
Another way to avoid spoofing would be to have AI analyze the usernames for anomalies, if you have that kind of technology at your disposal. For a backyard web specialist, though, I think ASCII-only is a pretty good solution until you get more resources to do something better.
Alternatively, you could generate a unique random picture or word to be associated with every username, so people would know it's not spoofed (people wouldn't choose these pictures/words, and they wouldn't need to know them to log in; everyone would see them by, under, or above their username, though). That would actually be easier and probably more effective, as long as the people the URL was intended for were familiar with this random word.