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

Breadcrumb

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

function UnicodeString::__construct

Overrides AbstractString::__construct

File

vendor/symfony/string/UnicodeString.php, line 35

Class

UnicodeString
Represents a string of Unicode grapheme clusters encoded as UTF-8.

Namespace

Symfony\Component\String

Code

public function __construct(string $string = '') {
    if ('' === $string || normalizer_is_normalized($this->string = $string)) {
        return;
    }
    if (false === ($string = normalizer_normalize($string))) {
        throw new InvalidArgumentException('Invalid UTF-8 string.');
    }
    $this->string = $string;
}
RSS feed
Powered by Drupal