Closed Naoya9922 closed 2 years ago
@Naoya9922 This is a very interesting situation... I'm not even sure if Excel allows strings with null bytes, to begin with... How did you run into this problem? Did you open an existing workbook and tried to save it? Or?
But, either way, this error is not of RubyXL
per se, but of nokogiri, so you should ask its authors.
Here's the minimal code to reproduce:
require 'nokogiri'
xml = Nokogiri::XML('<?xml version = "1.0" standalone ="yes"?>')
xml.create_element("somehing", {}, "test" + 0.chr + "test")
Actually, I found this
Thank you for maintaining this awesome gem.
I have noticed that when a cell contains null character(\x00), it fails to write workbook with the error saying "string contains null byte (ArgumentError)". Is it better to replace to another character when a cell contains null character?
Gemfile.lock
Code to reproduce the issue