From bd0f3345a938b35ce6a12f6150373b0955b8dd12 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 10 Jul 2011 15:24:15 -0500 Subject: Add Qt3 development HEAD version --- plugins/src/codecs/kr/main.cpp | 47 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 plugins/src/codecs/kr/main.cpp (limited to 'plugins/src/codecs/kr/main.cpp') diff --git a/plugins/src/codecs/kr/main.cpp b/plugins/src/codecs/kr/main.cpp new file mode 100644 index 0000000..2b80442 --- /dev/null +++ b/plugins/src/codecs/kr/main.cpp @@ -0,0 +1,47 @@ +#include +#include +#include + +#include +#include + + +class KRTextCodecs : public QTextCodecPlugin +{ +public: + KRTextCodecs() {} + + QStringList names() const { return QStringList() << "eucKR" << "ksc5601.1987-0"; } + QValueList mibEnums() const { return QValueList() << 38 << 36; } + QTextCodec *createForMib( int ); + QTextCodec *createForName( const QString & ); +}; + + +QTextCodec *KRTextCodecs::createForMib( int mib ) +{ + switch (mib) { + case 36: + return new QFontKsc5601Codec; + case 38: + return new QEucKrCodec; + default: + ; + } + + return 0; +} + + +QTextCodec *KRTextCodecs::createForName( const QString &name ) +{ + if (name == "eucKR") + return new QEucKrCodec; + if (name == "ksc5601.1987-0") + return new QFontKsc5601Codec; + + return 0; +} + + +Q_EXPORT_PLUGIN( KRTextCodecs ); -- cgit v1.2.1