I want to split u"an arbitrary unicode string"
into chunks of say 300 bytes without destroying any characters. The strings will be written to a socket that expects utf8 using unicode_string.encode("utf8")
. I don't want to destroy any characters. How would I do this?