code: def pack_unicode(cls, value, charset="utf-8", errors="strict"):
          
          assert isinstance(value, unicode)
  
          try:
              value = value.encode(charset, errors)
          except UnicodeEncodeError as e:
              raise InvalidData("Error encoding unicode value '%s': %s" % (repr(value), e))
  
          value_len_packed = cls.pack_int_base128(len(value))
          return struct.pack("<%ds%ds" % (len(value_len_packed), len(value)), value_len_packed,  value)
docs: Pack string field
          <field> ::= <int32_varint><data>
  
          :param value: string to be packed
          :type value: unicode
  
          :return: packed value
          :rtype: bytes