summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs/qgb18030codec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/codecs/qgb18030codec.cpp')
-rw-r--r--src/corelib/codecs/qgb18030codec.cpp146
1 files changed, 0 insertions, 146 deletions
diff --git a/src/corelib/codecs/qgb18030codec.cpp b/src/corelib/codecs/qgb18030codec.cpp
index badba7d09bb..030b353090f 100644
--- a/src/corelib/codecs/qgb18030codec.cpp
+++ b/src/corelib/codecs/qgb18030codec.cpp
@@ -580,152 +580,6 @@ QByteArray QGb2312Codec::convertFromUnicode(const QChar *uc, int len, ConverterS
}
-#ifdef Q_OS_UNIX
-
-QFontGb2312Codec::QFontGb2312Codec()
-{
-}
-
-
-QByteArray QFontGb2312Codec::_name()
-{
- return "gb2312.1980-0";
-}
-
-
-int QFontGb2312Codec::_mibEnum()
-{
- return 57;
-}
-
-
-QString QFontGb2312Codec::convertToUnicode(const char* /*chars*/, int /*len*/, ConverterState *) const
-{
- return QString();
-}
-
-QByteArray QFontGb2312Codec::convertFromUnicode(const QChar *uc, int len, ConverterState *) const
-{
- QByteArray result;
- result.resize(len * 2);
- uchar *rdata = (uchar *) result.data();
- const QChar *ucp = uc;
-
- //qDebug("QFontGb2312Codec::fromUnicode(const QString& uc, int& lenInOut = %d)", lenInOut);
- uchar buf[8];
- for (int i = 0; i < len; i++) {
- QChar ch(*ucp++);
-
- int len = qt_UnicodeToGbk(ch.unicode(), buf);
-
- if (len == 2 && buf[0] > 0xa0 && buf[1] > 0xa0) {
- *rdata++ = buf[0] & 0x7f;
- *rdata++ = buf[1] & 0x7f;
- } else {
- *rdata++ = 0;
- *rdata++ = 0;
- }
- }
- return result;
-}
-
-
-QFontGbkCodec::QFontGbkCodec()
-{
-}
-
-
-QByteArray QFontGbkCodec::_name()
-{
- return "gbk-0";
-}
-
-
-int QFontGbkCodec::_mibEnum()
-{
- return -113;
-}
-
-
-QString QFontGbkCodec::convertToUnicode(const char* /*chars*/, int /*len*/, ConverterState *) const
-{
- return QString();
-}
-
-QByteArray QFontGbkCodec::convertFromUnicode(const QChar *uc, int len, ConverterState *) const
-{
- QByteArray result;
- result.resize(len * 2);
- uchar *rdata = (uchar *) result.data();
- const QChar *ucp = uc;
-
- //qDebug("QFontGbkCodec::fromUnicode(const QString& uc, int& lenInOut = %d)", lenInOut);
- for (int i = 0; i < len; i++) {
- QChar ch(*ucp++);
- uchar buf[8];
-
- int len = qt_UnicodeToGbk(ch.unicode(), buf);
-
- if (len == 2) {
- *rdata++ = buf[0];
- *rdata++ = buf[1];
- } else {
- *rdata++ = 0;
- *rdata++ = 0;
- }
- }
- return result;
-}
-
-
-QFontGb18030_0Codec::QFontGb18030_0Codec()
-{
- //qDebug("QFontGb18030_0Codec::QFontGb18030_0Codec()");
-}
-
-
-QByteArray QFontGb18030_0Codec::_name()
-{
- //qDebug("QFontGb18030_0Codec::name() = \"gb18030-0\"");
- return "gb18030-0";
-}
-
-
-int QFontGb18030_0Codec::_mibEnum()
-{
- //qDebug("QFontGb18030_0Codec::mibEnum() = -114");
- return -114;
-}
-
-
-QString QFontGb18030_0Codec::convertToUnicode(const char* /*chars*/, int /*len*/, ConverterState *) const
-{
- return QString();
-}
-
-QByteArray QFontGb18030_0Codec::convertFromUnicode(const QChar *uc, int len, ConverterState *) const
-{
- QByteArray result;
- result.resize(len * 2);
- uchar *rdata = (uchar *) result.data();
- const QChar *ucp = uc;
-
- //qDebug("QFontGb18030_0Codec::fromUnicode(const QString& uc, int& lenInOut = %d)", lenInOut);
- for (int i = 0; i < len; i++) {
- QChar ch(*ucp++);
- if (ch.row () > 0 && !(ch.row () >= 0xd8 && ch.row () < 0xe0)) {
- *rdata++ = ch.row();
- *rdata++ = ch.cell();
- } else {
- *rdata++ = 0x0;
- *rdata++ = 0x0;
- }
- }
- return result;
-}
-
-#endif // Q_OS_UNIX
-
static const indexTbl_t gb18030_to_ucs_index[154] = {
/* U+00__ */ {0x00, 0xFF, 0x0000, 0x0000}, {0x00, 0xFF, 0x0000, 0x0000},