Understanding and avoiding visually ambiguous characters in IDs

#35 · 🔥 279 · 💬 199 · 11 days ago · gajus.com · gajus · 📷
It is frustrating when the experience is marred by an easy mistake to avoid - visually ambiguous characters. 8 / B - These characters might be mixed up when poorly written or in certain stylized fonts. On the other hand, if you decide to make your IDs case-insensitive, you have only 22 characters to choose from. Personally, I would be wary of excluding characters just because they look like other characters when combined. In some cases, you might also want to avoid characters that sound similar when spoken. This takes the approach of allowing ambiguous characters by decoding them to the same value, and also considers the problem of accidental obscenities. A character set I like to use when I need something like this is the one used by Open Location Code, which is 23456789CFGHJMPQRVWX. It was apparently chosen not only to avoid visually ambiguous characters, but also to avoid spelling words in common languages.
Understanding and avoiding visually ambiguous characters in IDs



Send Feedback | WebAssembly Version (beta)