private static function get_adjacent_chr( \DOMNode $node, $position, $length, callable $get_textnode ) {
		$textnode = $get_textnode( $node );

		if ( isset( $textnode ) && isset( $textnode->data ) ) {
			// Determine encoding.
			$func = Strings::functions( $textnode->data );

			if ( ! empty( $func ) ) {
				return \preg_replace( '/\p{C}/Su', '', $func['substr']( $textnode->data, $position, $length ) );
			}
		}

		return '';
	}