Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Xml.php

function Xml::convertToUtf8

1 call to Xml::convertToUtf8()
Xml::prepareString in vendor/phpunit/phpunit/src/Util/Xml/Xml.php
Escapes a string for the use in XML documents.

File

vendor/phpunit/phpunit/src/Util/Xml/Xml.php, line 46

Class

Xml
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Util

Code

private static function convertToUtf8(string $string) : string {
    if (!self::isUtf8($string)) {
        $string = mb_convert_encoding($string, 'UTF-8');
    }
    return $string;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal