Exemplo n.º 1
0
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();
	}
}
Exemplo n.º 3
0
EncodedTextReader::EncodedTextReader(const std::string &encoding) {
	ZLEncodingCollection &collection = ZLEncodingCollection::Instance();
	ZLEncodingConverterInfoPtr info = collection.info(encoding);
	myConverter = !info.isNull() ? info->createConverter() : collection.defaultConverter();
}