function __construct($from_encoding = null, $convert_html_entities = false) { $this->from_encoding = $from_encoding ? $from_encoding : Encoding::system(); $this->encoding_converter = EncodingConverter::create($this->from_encoding, Utf8::NAME); $this->convert_html_entities = $convert_html_entities; $this->reset(); }
/** * * @param type $from * @return Utf8Encoder */ public function encoder($from = null) { $from = $from ? $from : Encoding::system(); return new Utf8Encoder($from); }
function __construct($to_encoding = null) { $this->to_encoding = $to_encoding ? $to_encoding : Encoding::system(); $this->encoding_converter = EncodingConverter::create(Utf8::NAME, $this->to_encoding); $this->reset(); }
/** * Returns an encoder that convert from another encoding to this encoding. * * @param string|Encoder $from Encoding to convert from, defaults to system encoding. * @return Converter */ public function encoder($from = null) { $from = $from ? $from : Encoding::system(); $to = $this; return EncodingConverter::create($from, $to); }