static int fUnknownEncodingHandler(void*, const XML_Char *name, XML_Encoding *encoding) { ZLEncodingConverterInfoPtr info = ZLEncodingCollection::instance().info(name); if (!info.isNull()) { shared_ptr<ZLEncodingConverter> converter = info->createConverter(); if (!converter.isNull() && converter->fillTable(encoding->map)) { return XML_STATUS_OK; } } return XML_STATUS_ERROR; }
void RtfDescriptionReader::setEncoding(int code) { ZLEncodingCollection &collection = ZLEncodingCollection::instance(); ZLEncodingConverterInfoPtr info = collection.info(code); if (info) { myConverter = info->createConverter(); myDescription.encoding() = info->name(); } else { myConverter = collection.defaultConverter(); } }
EncodedTextReader::EncodedTextReader(const std::string &encoding) { ZLEncodingCollection &collection = ZLEncodingCollection::Instance(); ZLEncodingConverterInfoPtr info = collection.info(encoding); myConverter = !info.isNull() ? info->createConverter() : collection.defaultConverter(); }