unichr is not the problem, it's a sideshow.
>
> I can not include attachment since using web interface, but I will
> send u another email with the corrupt excel file.
Received. Thanks.
The problem is that each string written needs to be prefixed by a length
field. This is variously described as "number of characters" (OOo) and
"the count of characters in the string" (MS). MS goes on to refer to these
characters as "double-byte" characters.
What is actually required is:
len(unicode_string.encode('utf_16_le')) // 2
Currently xlwt uses len(unicode_string)
On a narrow-unicode Python, len(u'\U0001D400') == 2 which is
(accidentally) the right answer. On a wide-unicode build, the result is 1,
which results in a corrupted SST (shared string table) in the file.
This will require changes to xlwt. ETA: this weekend.
Cheers,
John