You are here

public static function PHPExcel_Shared_String::SanitizeUTF8 in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/String.php \PHPExcel_Shared_String::SanitizeUTF8()

* Try to sanitize UTF8, stripping invalid byte sequences. Not perfect. Does not surrogate characters. * *

Parameters

string $value: * @return string

2 calls to PHPExcel_Shared_String::SanitizeUTF8()
PHPExcel_Cell_AdvancedValueBinder::bindValue in vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/AdvancedValueBinder.php
Bind value to a cell
PHPExcel_Cell_DefaultValueBinder::bindValue in vendor/phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php
Bind value to a cell

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/String.php, line 383

Class

PHPExcel_Shared_String
PHPExcel_Shared_String

Code

public static function SanitizeUTF8($value) {
  if (self::getIsIconvEnabled()) {
    $value = @iconv('UTF-8', 'UTF-8', $value);
    return $value;
  }
  if (self::getIsMbstringEnabled()) {
    $value = mb_convert_encoding($value, 'UTF-8', 'UTF-8');
    return $value;
  }

  // else, no conversion
  return $value;
}