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

Breadcrumb

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

function Unescaper::utf8chr

Get the UTF-8 character for the given code point.

File

vendor/symfony/yaml/Unescaper.php, line 94

Class

Unescaper
Unescaper encapsulates unescaping rules for single and double-quoted YAML strings.

Namespace

Symfony\Component\Yaml

Code

private static function utf8chr(int $c) : string {
    if (0x80 > ($c %= 0x200000)) {
        return \chr($c);
    }
    if (0x800 > $c) {
        return \chr(0xc0 | $c >> 6) . \chr(0x80 | $c & 0x3f);
    }
    if (0x10000 > $c) {
        return \chr(0xe0 | $c >> 12) . \chr(0x80 | $c >> 6 & 0x3f) . \chr(0x80 | $c & 0x3f);
    }
    return \chr(0xf0 | $c >> 18) . \chr(0x80 | $c >> 12 & 0x3f) . \chr(0x80 | $c >> 6 & 0x3f) . \chr(0x80 | $c & 0x3f);
}

API Navigation

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