def write_url_web(row1, col1, row2, col2, url, str = nil, format = nil)       #:nodoc:
    ruby_19 { url = convert_to_ascii_if_ascii(url) }

    record = 0x01B8                       # Record identifier
    length = 0x00000                      # Bytes to follow

    xf     = format || url_format        # The cell format

    # Write the visible label but protect against url recursion in write().
    str          = url unless str
    error        = write_string(row1, col1, str, xf)
    return error if error == -2

    # Pack the undocumented parts of the hyperlink stream
    unknown1    = ["D0C9EA79F9BACE118C8200AA004BA90B02000000"].pack("H*")
    unknown2    = ["E0C9EA79F9BACE118C8200AA004BA90B"].pack("H*")

    # Pack the option flags
    options     = [0x03].pack("V")

    # URL encoding.
    encoding    = 0

    # Convert an Utf8 URL type and to a null terminated wchar string.
    if is_utf8?(url)
      url = utf8_to_16be(url)
      # URL is null terminated.
      ruby_18 { url += "\0\0" } ||
      ruby_19 { url += "\0\0".force_encoding('UTF-16BE') }
      encoding = 1
    end

    # Convert an Ascii URL type and to a null terminated wchar string.
    if encoding == 0
      url  =
        ruby_18 { url + "\0" } ||
        ruby_19 { url.force_encoding('BINARY') + "\0".force_encoding('BINARY') }
      url  = url.unpack('c*').pack('v*')
    end

    # Pack the length of the URL
    url_len     = [url.bytesize].pack("V")

    # Calculate the data length
    length         = 0x34 + url.bytesize

    # Pack the header data
    header      = [record, length].pack("vv")
    data        = [row1, row2, col1, col2].pack("vvvv")

    # Write the packed data
    append( header, data,unknown1,options,unknown2,url_len,url)

    error
  end
def write_url_web(row1, col1, row2, col2, url, str = nil, format = nil)       #:nodoc:
    ruby_19 { url = convert_to_ascii_if_ascii(url) }

    record = 0x01B8                       # Record identifier
    length = 0x00000                      # Bytes to follow

    xf     = format || url_format        # The cell format

    # Write the visible label but protect against url recursion in write().
    str          = url unless str
    error        = write_string(row1, col1, str, xf)
    return error if error == -2

    # Pack the undocumented parts of the hyperlink stream
    unknown1    = ["D0C9EA79F9BACE118C8200AA004BA90B02000000"].pack("H*")
    unknown2    = ["E0C9EA79F9BACE118C8200AA004BA90B"].pack("H*")

    # Pack the option flags
    options     = [0x03].pack("V")

    # URL encoding.
    encoding    = 0

    # Convert an Utf8 URL type and to a null terminated wchar string.
    if is_utf8?(url)
      url = utf8_to_16be(url)
      # URL is null terminated.
      ruby_18 { url += "\0\0" } ||
      ruby_19 { url += "\0\0".force_encoding('UTF-16BE') }
      encoding = 1
    end

    # Convert an Ascii URL type and to a null terminated wchar string.
    if encoding == 0
      url  =
        ruby_18 { url + "\0" } ||
        ruby_19 { url.force_encoding('BINARY') + "\0".force_encoding('BINARY') }
      url  = url.unpack('c*').pack('v*')
    end

    # Pack the length of the URL
    url_len     = [url.bytesize].pack("V")

    # Calculate the data length
    length         = 0x34 + url.bytesize

    # Pack the header data
    header      = [record, length].pack("vv")
    data        = [row1, row2, col1, col2].pack("vvvv")

    # Write the packed data
    append( header, data,unknown1,options,unknown2,url_len,url)

    error
  end
row1                         # Start row
    col1                         # Start column
    row2                         # End row
    col2                         # End column
    url                          # URL string
    str                          # Alternative label

 Used to write http, ftp and mailto hyperlinks.
 The link type ($options) is 0x03 is the same as absolute dir ref without
 sheet. However it is differentiated by the $unknown2 data stream.

 See also write_url() above for a general description and return values.