toLowercase() and toUppercase() fail on foreign characters

isLowercase() and isUppercase() failed on whitespace, punctuation marks and non-ascii letters because of a too strict regular expression check. Changed it to compare the given string to the result of the native toLowerCase() or toUpperCase() functions.