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/jp/main.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 plugins/src/codecs/jp/main.cpp (limited to 'plugins/src/codecs/jp/main.cpp') diff --git a/plugins/src/codecs/jp/main.cpp b/plugins/src/codecs/jp/main.cpp new file mode 100644 index 0000000..c7ed27c --- /dev/null +++ b/plugins/src/codecs/jp/main.cpp @@ -0,0 +1,56 @@ +#include +#include +#include + +#include +#include +#include +#include + + +class JPTextCodecs : public QTextCodecPlugin +{ +public: + JPTextCodecs() {} + + QStringList names() const { return QStringList() << "eucJP" << "JIS7" << "SJIS" << "jisx0208.1983-0"; } + QValueList mibEnums() const { return QValueList() << 16 << 17 << 18 << 63; } + QTextCodec *createForMib( int ); + QTextCodec *createForName( const QString & ); +}; + +QTextCodec *JPTextCodecs::createForMib( int mib ) +{ + switch (mib) { + case 16: + return new QJisCodec; + case 17: + return new QSjisCodec; + case 18: + return new QEucJpCodec; + case 63: + return new QFontJis0208Codec; + default: + ; + } + + return 0; +} + + +QTextCodec *JPTextCodecs::createForName( const QString &name ) +{ + if (name == "JIS7") + return new QJisCodec; + if (name == "SJIS") + return new QSjisCodec; + if (name == "eucJP") + return new QEucJpCodec; + if (name == "jisx0208.1983-0") + return new QFontJis0208Codec; + + return 0; +} + + +Q_EXPORT_PLUGIN( JPTextCodecs ); -- cgit v1.2.1