ujiantara2010 / php-excel-reader

Automatically exported from code.google.com/p/php-excel-reader
0 stars 0 forks source link

Links for URLs are missing the last character #81

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a spreadsheet in which the cell is a URL, http://foo.bar.com/one/two
2. Run php-excel-reader

What is the expected output? What do you see instead?
In the HTML, the URL displays properly, but it links to 
http://foo.bar.com/one/tw (notice the last letter is missing)

Please provide any additional information below.
My guess is function _encodeUTF16() is at fault.

Original issue reported on code.google.com by d...@cimpress.com on 9 Jul 2010 at 4:41

GoogleCodeExporter commented 8 years ago
Patch by modifying the function to:

    function read16bitstring($data, $start) {
        $len = 0;
        while (ord($data[$start + $len]) + ord($data[$start + $len + 1]) > 0) $len++;
        return substr($data, $start, $len+1);
    }

Original comment by carsten....@gmail.com on 17 Aug 2012 at 11:07