getCharset() public method

gets charset for rtf text inputs
public getCharset ( ) : string
return string
Exemplo n.º 1
0
 /**
  * renders form field
  */
 public function render()
 {
     $stream = $this->_rtf->getWriter();
     $stream->write(' ');
     if ($this->_font) {
         $stream->write('{' . $this->_font->getContent());
     }
     $defaultValue = PHPRtfLite_Utf8::getUnicodeEntities($this->_defaultValue, $this->_rtf->getCharset());
     $content = '{\\field' . '{\\*\\fldinst ' . $this->getType() . '  {\\*\\formfield' . $this->getRtfCode() . '}' . '}{\\fldrslt ' . $defaultValue . '}}';
     $stream->write($content);
     if ($this->_font) {
         $stream->write($this->_font->getClosingContent() . '}');
     }
     $stream->write(' ');
 }
Exemplo n.º 2
0
 /**
  * renders footnote/endnote
  */
 public function render()
 {
     $stream = $this->_rtf->getWriter();
     $typeSetting = $this->_typeSettingType != self::TYPE_NORMAL ? '\\' . $this->_typeSettingType : '';
     $stream->write('{' . $typeSetting . '\\chftn}' . '{' . $this->getTypeAsRtfCode() . '\\pard\\plain\\lin283\\fi-283 ');
     if ($this->_parFormat) {
         $stream->write($this->_parFormat->getContent());
     }
     if ($this->_font) {
         $stream->write($this->_font->getContent());
     }
     $charset = $this->_rtf->getCharset();
     $textEncoded = PHPRtfLite::quoteRtfCode($this->_text);
     $stream->write('{\\up6\\chftn}' . "\r\n" . PHPRtfLite_Utf8::getUnicodeEntities($textEncoded, $charset) . '} ');
 }