You are here

function PHPExcel_Writer_Excel5_Parser::_convertString in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Parser.php \PHPExcel_Writer_Excel5_Parser::_convertString()

* Convert a string token to ptgStr * * @access private *

Parameters

string $string A string for conversion to its ptg value.: * @return mixed the converted token on success

1 call to PHPExcel_Writer_Excel5_Parser::_convertString()
PHPExcel_Writer_Excel5_Parser::_convert in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Parser.php
* Convert a token to the proper ptg value. * * @access private *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel5/Parser.php, line 596

Class

PHPExcel_Writer_Excel5_Parser
PHPExcel_Writer_Excel5_Parser

Code

function _convertString($string) {

  // chop away beggining and ending quotes
  $string = substr($string, 1, strlen($string) - 2);
  if (strlen($string) > 255) {
    throw new PHPExcel_Writer_Exception("String is too long");
  }
  return pack('C', $this->ptg['ptgStr']) . PHPExcel_Shared_String::UTF8toBIFF8UnicodeShort($string);
}