summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/plugins/src/codecs/jp/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tqtinterface/qt4/plugins/src/codecs/jp/main.cpp')
-rw-r--r--tqtinterface/qt4/plugins/src/codecs/jp/main.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/tqtinterface/qt4/plugins/src/codecs/jp/main.cpp b/tqtinterface/qt4/plugins/src/codecs/jp/main.cpp
new file mode 100644
index 0000000..8b0f8f9
--- /dev/null
+++ b/tqtinterface/qt4/plugins/src/codecs/jp/main.cpp
@@ -0,0 +1,56 @@
+#include <tqtextcodecplugin.h>
+#include <tqtextcodec.h>
+#include <tqptrlist.h>
+
+#include <tqeucjpcodec.h>
+#include <tqjiscodec.h>
+#include <tqsjiscodec.h>
+#include <private/tqfontcodecs_p.h>
+
+
+class JPTextCodecs : public TQTextCodecPlugin
+{
+public:
+ JPTextCodecs() {}
+
+ TQStringList names() const { return TQStringList() << "eucJP" << "JIS7" << "SJIS" << "jisx0208.1983-0"; }
+ TQValueList<int> mibEnums() const { return TQValueList<int>() << 16 << 17 << 18 << 63; }
+ TQTextCodec *createForMib( int );
+ TQTextCodec *createForName( const TQString & );
+};
+
+TQTextCodec *JPTextCodecs::createForMib( int mib )
+{
+ switch (mib) {
+ case 16:
+ return new TQJisCodec;
+ case 17:
+ return new TQSjisCodec;
+ case 18:
+ return new TQEucJpCodec;
+ case 63:
+ return new TQFontJis0208Codec;
+ default:
+ ;
+ }
+
+ return 0;
+}
+
+
+TQTextCodec *JPTextCodecs::createForName( const TQString &name )
+{
+ if (name == "JIS7")
+ return new TQJisCodec;
+ if (name == "SJIS")
+ return new TQSjisCodec;
+ if (name == "eucJP")
+ return new TQEucJpCodec;
+ if (name == "jisx0208.1983-0")
+ return new TQFontJis0208Codec;
+
+ return 0;
+}
+
+
+TQ_EXPORT_PLUGIN( JPTextCodecs );