Converting unicode string to bytes in assert