# File lib/spreadsheet/excel/writer/workbook.rb, line 536
  def write_string_part writer, op, data, wide
    bef = data.size
    ## if we're writing wide characters, we need to make sure we don't cut
    #  characters in half
    if wide > 0 && data.size > @recordsize_limit
      remove = @recordsize_limit - data.size
      remove -= remove % 2
      rest = data.slice!(remove..-1)
      write_op writer, op, data
      data = rest
    else
      data = write_op writer, op, data
    end
    op = 0x003c
    # Unicode strings are split in a special way. At the beginning of each
    # CONTINUE record the option flags byte is repeated. Only the
    # character size flag will be set in this flags byte, the Rich-Text
    # flag and the Far-East flag are set to zero.
    unless data.empty?
      if wide == 1
        # check if we can compress the rest of the string
        data, wide = compress_unicode_string data
      end
      data = [wide].pack('C') << data
    end
    [op, data, wide]
  end