MAJOR encoding fix

Fixed to handle certain special characters. Some testing, but there
could be issues!