pear/Spreadsheet_Excel_Writer — pull request #1 by LaserBears (2013-04-16 18:40:51+00:00)
Title: Fixed PEAR bug #19904:  UTF-16 surrogate pairs trigger "Excel found unreadable content" error

Fixed a bug in the Spreadsheet_Excel_Writer_Worksheet::writeStringBIFF8() method where the length of Unicode strings was being calculated based on the number of characters, and if the string contained any UTF-16 surrogate pairs then a "found unreadable content" error would occur when opening the worksheet in Excel (it apparently expects Unicode string lengths to be the number of 16-bit code points, not the number of characters).

See https://pear.php.net/bugs/bug.php?id=19904 for a test case.