Don't know, and the code posted is too long to read properly, but please check all these if blocks. You are checking whether the characters are in a particular range. Please go through those ranges and see that they don't restrict you to using a particular subgroup of character values. Also have a look at the Character class, which has all sorts of useful methods for checking types of character.