added fix for unicode support

added fix for unicode support so it doesn't crash out when encountering unicode characters.