def write_longstr(self, s):
self._flushbits()<EOL>if isinstance(s, string):<EOL><INDENT>s = s.encode('<STR_LIT:utf-8>')<EOL><DEDENT>self.write_long(len(s))<EOL>self.out.write(s)<EOL>
Write a string up to 2**32 bytes long after encoding.

        If passed a unicode string, encode as UTF-8.