exchanged the ugly encode call for a unicode_literals import from future