Added isInCharset() to test whether or not a string can be encoded with certain character set