Hi all,
When validating user inputs in an application that is to be run across multiple locales, what is the most appropriate way of doing this? I encountered this in a project I was on a few years ago, and I am interested now in looking back at how else we could have tackled this problem.
Ideas I have had are to either write an input condition that is valid across multiple locales, or to use a large switch statement (I don't like this one), or to write a locale specific regex that can be stored in an external properties file (or similar). The third option is my preferred method but I am interested in hearing others.
An example of this problem would be for example in the use of accented letters in a more widespread context within Continental European languages, or different character sets entirely.
So if validation is needed on input, and the condition will vary depending on locale, which is the best way to handle this problem.
PS: I am not specifically looking for a solution in a particular language, more for approaches to the problem in general.