Fix blowup on unicode string.

Otherwise will see a 'UnicodeEncodeError'.