http://qs321.pair.com?node_id=435023


in reply to Re: Strange behaviour (Spreadsheet::WriteExcell)
in thread Strange behaviour (Spreadsheet::WriteExcell)

Unfortunately the script is too big (and commercially sensitive) to easily produce a publishable version. As you can see from my comments I don't have enough of an understanding of the problem to be able to submit a bug report that would be of much help.

The data being output did originate in an XML file, and the script is running here under 5.6, so your second suggestion looks like a good candidate. As I said I suspect some kind of utf8 type issue but I cannot see anything that looks wrong.

Anyway I have found a fix, in my original code just before the write_string() I have inserted:

if(length($val) > 100) { # For some reason we have to duplicate # the contents of the string via a process # that detaches from the original variable # if the string is longer than 136 characters # (I don't know why) my $t = pack("c".length($val), unpack("c".length($val),$val)); $val = $t; }

Now it all seems to work :-O