I am implementing the code to check whether user input has valid ascii code or not. In order to do that, I found some simple way like below,
if (!firstName.matches("\\p{ASCII}*")) {
return error;
}
I tested it in my local which is windows os based, I found that it worked well.
After testing, I deployed into our QA which is on linux system, it never works, it returns error regardless of valid ascii or not. Does anybody have this kind of problem before? Could you please give some advice?