Mike42\Escpos\PrintBuffers\EscposPrintBuffer::identifyText PHP Method

identifyText() private method

Later parts of the text need not be included in the returned code page.
private identifyText ( string $text ) : boolean | integer
$text string Input text to check.
return boolean | integer Code page number, or FALSE if the text is not printable on any supported encoding.
    private function identifyText($text)
    {
        // TODO Replace this with an algorithm to choose the encoding which will
        //      encode the farthest into the string, to minimise code page changes.
        $char = mb_substr($text, 0, 1, self::INPUT_ENCODING);
        if (!isset($this->available[$char])) {
            /* Character not available anywhere */
            return false;
        }
        foreach ($this->available[$char] as $encodingNo => $true) {
            /* Return first code-page where it is available */
            return $encodingNo;
        }
        return false;
    }