You are here

private static function Utils::removeUtf8Bom in Drupal driver for SQL Server and SQL Azure 4.2.x

Same name and namespace in other branches
  1. 3.1.x src/Driver/Database/sqlsrv/Utils.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Utils::removeUtf8Bom()
  2. 4.0.x src/Driver/Database/sqlsrv/Utils.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Utils::removeUtf8Bom()
  3. 4.1.x src/Driver/Database/sqlsrv/Utils.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Utils::removeUtf8Bom()

Remove UTF8 BOM.

Parameters

string $text: UTF8 text.

Return value

string Text without UTF8 BOM.

1 call to Utils::removeUtf8Bom()
Utils::deployCustomFunctions in src/Driver/Database/sqlsrv/Utils.php
Deploy custom functions for Drupal Compatiblity.

File

src/Driver/Database/sqlsrv/Utils.php, line 140

Class

Utils
Utility function for the SQL Server driver.

Namespace

Drupal\sqlsrv\Driver\Database\sqlsrv

Code

private static function removeUtf8Bom($text) {
  $bom = pack('H*', 'EFBBBF');
  $text = preg_replace("/^{$bom}/", '', $text);
  return $text;
}