Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php
public static function UTF8toBIFF8UnicodeLong($value)
    {
        // character count
        $ln = self::countCharacters($value, 'UTF-8');

        // characters
        $chars = self::convertEncoding($value, 'UTF-16LE', 'UTF-8');

        $data = pack('vC', $ln, 0x0001) . $chars;

        return $data;
    }
public static function UTF8toBIFF8UnicodeLong($value)
    {
        // character count
        $ln = self::countCharacters($value, 'UTF-8');

        // characters
        $chars = self::convertEncoding($value, 'UTF-16LE', 'UTF-8');

        $data = pack('vC', $ln, 0x0001) . $chars;

        return $data;
    }
public static function UTF8toBIFF8UnicodeLong ( $ value ) { // character count $ ln = self :: countCharacters ( $ value , 'UTF-8' ) ; // characters $ chars = self :: convertEncoding ( $ value , 'UTF-16LE' , 'UTF-8' ) ; $ data = pack ( 'vC' , $ ln , 0x0001 ) . $ chars ; return $ data ; }
Converts a UTF-8 string into BIFF8 Unicode string data (16-bit string length)
Writes the string using uncompressed notation, no rich text, no Asian phonetics
If mbstring extension is not available, ASCII is assumed, and compressed notation is used
although this will give wrong results for non-ASCII strings
see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. 2.5.3.

@param string $value UTF-8 encoded string

@return string
Converts a UTF - 8 string into BIFF8 Unicode string data ( 16 - bit string length ) Writes the string using uncompressed notation no rich text no Asian phonetics If mbstring extension is not available ASCII is assumed and compressed notation is used although this will give wrong results for non - ASCII strings see OpenOffice . org s Documentation of the Microsoft Excel File Format sect . 2 . 5 . 3 .