functions added to verify UTF-8 encoding