correctly implement strings as UTF-8

Characters outside the ASCII range are incorrectly encoded. This ensures that all string content is sent/received as UTF-8.