I'm not sure honestly. I just had a use case where the token came in as unicode and everything exploded because it wasn't encoded yet. The else below was there previously.