Mike42\Escpos\CodePage::isEncodable PHP Method

isEncodable() public method

public isEncodable ( ) : boolean
return boolean True if we can encode with this code page (ie, we know what data it holds). Many printers contain vendor-specific code pages, which are named but have not been identified or typed out. For our purposes, this is an "un-encodeable" code page.
    public function isEncodable()
    {
        return $this->iconv !== null || $this->data !== null;
    }

Usage Example

Beispiel #1
0
 public function testDataCannotEncode()
 {
     $this->setExpectedException('\\InvalidArgumentException');
     $cp = new CodePage("foo", array("name" => "foo"));
     $this->assertFalse($cp->isEncodable());
     $cp->getData();
 }