protected function FormatControlSymbol(RtfControlSymbol $symbol) { if ($symbol->getSymbol() === '\'') { $this->BeginState(); switch ($this->root->getCharset()) { default: case "ansi": case "pc": case "pca": $encoding = 'windows-1252'; break; case "mac": $encoding = 'macroman'; break; } $this->output .= htmlentities(chr($symbol->getValue()), ENT_QUOTES, $encoding); $this->EndState(); } else { $this->BeginState(); $this->output .= $symbol->__toHtml(); $this->EndState(); } }
protected function parseControlSymbol() { // Read symbol (one character only). $this->getChar(); $symbol = $this->char; if ($symbol === '\'') { // Symbols ordinarily have no parameter. However, // if this is \', then it is followed by a 2-digit hex-code: $this->getChar(); $parameter = $this->char; $this->getChar(); $parameter .= $this->char; $rtfsymbol = new RtfHexaControlSymbol(); $rtfsymbol->setSymbol($symbol); $rtfsymbol->setValueFromHex($parameter); $this->group->children[] = $rtfsymbol; } else { $rtfsymbol = new RtfControlSymbol(); $rtfsymbol->setSymbol($symbol); $this->group->children[] = $rtfsymbol; } }
public function test_ign__toRtf() { $this->_object->setSymbol('*'); $this->assertSame('\\*', $this->_object->__toRtf()); }
public function __destruct() { parent::__destruct(); $this->_value = null; }