You are here

public static function Utils::removeUtf8Bom in Drupal driver for SQL Server and SQL Azure 8.2

Same name and namespace in other branches
  1. 3.0.x drivers/lib/Drupal/Driver/Database/sqlsrv/Utils.php \Drupal\Driver\Database\sqlsrv\Utils::removeUtf8Bom()

Remove Byte Order Mark from UTF8 string.

Parameters

string $text:

Return value

string

2 calls to Utils::removeUtf8Bom()
Index::GetCode in src/Indexes/Index.php
Get the SQL statement to create this index.
Utils::DeployCustomFunctions in drivers/lib/Drupal/Driver/Database/sqlsrv/Utils.php
Deploy custom functions.

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Utils.php, line 105

Class

Utils

Namespace

Drupal\Driver\Database\sqlsrv

Code

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