changes to support UTF-8 encoding from