reworking properly support UTF-8, (code doesn't compile currently)