3 ms·
Serious question. Why on earth would you hard-code these, instead of simply call a lowercase function in the en-US locale? These are English words. Naively lo
by crazygringo 6y ago
Serious question.
Why on earth would you hard-code these, instead of simply call a lowercase function in the en-US locale?
These are English words. Naively lowercasing them according to whatever locale the server or user has set seems like a terrible programming practice. Any call to a lowercase function should be explicitly including an argument that specifies it's English, no?
In the same way we've all learned to never store times without an explicit timezone (even if it's UTC), or locate a string offset without knowing your encoding... you should never perform language transformations (case changes, accent removal, etc.) without a locale.
Hardcoding these things is just patching over the symptoms without addressing the cause, no?