2 ms·
A fun edge case, of the million edge cases for credit cards: If you have Japanese users, their browser/input method editor may send full-width characters by de
by patio11 7y ago
A fun edge case, of the million edge cases for credit cards:
If you have Japanese users, their browser/input method editor may send full-width characters by default, such as 4321 instead of 4321. You should probably honor those, but unless you wrote code to do this, you almost certainly won't. Even most Japanese sites are user-hostile here, either failing to detect them as numbers or telling the user "You wrote your number in full-width characters; please try again in half-width characters" despite them being trivially convertable.
(Disclaimer: this is professionally relevant to me and yes, Stripe Elements / Checkout do do the right thing here.)
- kevin_thibedeau 7y agoFor reference by others: You want to apply NFKC or NFKD Unicode normalization to collapse full-width Latin letters and digits to their usual form. This also widens half-width kana.