WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

PHPMailer\PHPMailer

PHPMailer::utf8CharBoundary() public WP 1.0

Find the last character boundary prior to $maxLength in a utf-8 quoted-printable encoded string. Original written by Colin Brown.

{} Это метод класса: PHPMailer{}

Хуков нет.

Возвращает

Число.

Использование

$PHPMailer = new PHPMailer();
$PHPMailer->utf8CharBoundary( $encodedText, $maxLength );
$encodedText(строка) (обязательный)
utf-8 QP text
$maxLength(число) (обязательный)
Find the last character boundary prior to this length

Код PHPMailer::utf8CharBoundary() WP 5.5.1

<?php
public function utf8CharBoundary($encodedText, $maxLength)
{
    $foundSplitPos = false;
    $lookBack = 3;
    while (!$foundSplitPos) {
        $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack);
        $encodedCharPos = strpos($lastChunk, '=');
        if (false !== $encodedCharPos) {
            // Found start of encoded character byte within $lookBack block.
            // Check the encoded byte value (the 2 chars after the '=')
            $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2);
            $dec = hexdec($hex);
            if ($dec < 128) {
                // Single byte character.
                // If the encoded char was found at pos 0, it will fit
                // otherwise reduce maxLength to start of the encoded char
                if ($encodedCharPos > 0) {
                    $maxLength -= $lookBack - $encodedCharPos;
                }
                $foundSplitPos = true;
            } elseif ($dec >= 192) {
                // First byte of a multi byte character
                // Reduce maxLength to split at start of character
                $maxLength -= $lookBack - $encodedCharPos;
                $foundSplitPos = true;
            } elseif ($dec < 192) {
                // Middle byte of a multi byte character, look further back
                $lookBack += 3;
            }
        } else {
            // No encoded character found
            $foundSplitPos = true;
        }
    }

    return $maxLength;
}