You are here

protected function PHPExcel_Reader_CSV::_skipBOM in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/CSV.php \PHPExcel_Reader_CSV::_skipBOM()

* Move filepointer past any BOM marker *

2 calls to PHPExcel_Reader_CSV::_skipBOM()
PHPExcel_Reader_CSV::listWorksheetInfo in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/CSV.php
* Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns) * *
PHPExcel_Reader_CSV::loadIntoExisting in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/CSV.php
* Loads PHPExcel from file into PHPExcel instance * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/CSV.php, line 137

Class

PHPExcel_Reader_CSV
PHPExcel_Reader_CSV

Code

protected function _skipBOM() {
  rewind($this->_fileHandle);
  switch ($this->_inputEncoding) {
    case 'UTF-8':
      fgets($this->_fileHandle, 4) == "" ? fseek($this->_fileHandle, 3) : fseek($this->_fileHandle, 0);
      break;
    case 'UTF-16LE':
      fgets($this->_fileHandle, 3) == "" ? fseek($this->_fileHandle, 2) : fseek($this->_fileHandle, 0);
      break;
    case 'UTF-16BE':
      fgets($this->_fileHandle, 3) == "" ? fseek($this->_fileHandle, 2) : fseek($this->_fileHandle, 0);
      break;
    case 'UTF-32LE':
      fgets($this->_fileHandle, 5) == "" ? fseek($this->_fileHandle, 4) : fseek($this->_fileHandle, 0);
      break;
    case 'UTF-32BE':
      fgets($this->_fileHandle, 5) == "" ? fseek($this->_fileHandle, 4) : fseek($this->_fileHandle, 0);
      break;
    default:
      break;
  }
}