Remove the font codecs

These codecs have only been used for XLFD based fonts.
These are not supported anymore by Qt 5.

Change-Id: I7dc083f2efcd42363b144b24bd62c169d83390cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Lars Knoll 2012-06-24 23:45:22 +02:00 committed by Qt by Nokia
parent 587b80f67d
commit d75a97793a
12 changed files with 2 additions and 902 deletions

View File

@ -13,8 +13,7 @@ HEADERS += \
codecs/qjiscodec_p.h \
codecs/qsjiscodec_p.h \
codecs/qeuckrcodec_p.h \
codecs/qbig5codec_p.h \
codecs/qfontjpcodec_p.h
codecs/qbig5codec_p.h
SOURCES += \
codecs/qisciicodec.cpp \
@ -29,12 +28,9 @@ SOURCES += \
codecs/qjiscodec.cpp \
codecs/qsjiscodec.cpp \
codecs/qeuckrcodec.cpp \
codecs/qbig5codec.cpp \
codecs/qfontjpcodec.cpp
codecs/qbig5codec.cpp
unix {
SOURCES += codecs/qfontlaocodec.cpp
contains(QT_CONFIG,iconv) {
HEADERS += codecs/qiconvcodec_p.h
SOURCES += codecs/qiconvcodec.cpp

View File

@ -1932,127 +1932,6 @@ QByteArray QBig5hkscsCodec::convertFromUnicode(const QChar *uc, int len, Convert
}
#ifdef Q_OS_UNIX
QFontBig5Codec::QFontBig5Codec()
{
//qDebug("QFontBig5Codec::QFontBig5Codec()");
}
QByteArray QFontBig5Codec::_name()
{
//qDebug("QFontBig5Codec::name() = \"big5-0\"");
return "big5-0";
}
int QFontBig5Codec::_mibEnum()
{
//qDebug("QFontBig5Codec::mibEnum() = -2026");
return -2026;
}
QString QFontBig5Codec::convertToUnicode(const char* /*chars*/, int /*len*/, ConverterState *) const
{
return QString();
}
QByteArray QFontBig5Codec::convertFromUnicode(const QChar *uc, int len, ConverterState *) const
{
//qDebug("QFontBig5Codec::fromUnicode(const QString& uc, int& lenInOut = %d)", lenInOut);
QByteArray result;
result.resize(len * 2);
uchar *rdata = (uchar *) result.data();
const QChar *ucp = uc;
for (int i = 0; i < len; i++) {
QChar ch(*ucp++);
uchar c[2];
#if 0
if (ch.row() == 0) {
if (ch.cell() == ' ')
ch = QChar(0x3000);
else if (ch.cell() > ' ' && ch.cell() < 127)
ch = QChar(ch.cell()-' ', 255);
}
#endif
if (qt_UnicodeToBig5hkscs(ch.unicode(), c) == 2 &&
c[0] >= 0xa1 && c[0] <= 0xf9) {
*rdata++ = c[0];
*rdata++ = c[1];
} else {
*rdata++ = 0;
*rdata++ = 0;
}
}
return result;
}
QFontBig5hkscsCodec::QFontBig5hkscsCodec()
{
//qDebug("QFontBig5hkscsCodec::QFontBig5hkscsCodec()");
}
QByteArray QFontBig5hkscsCodec::_name()
{
//qDebug("QFontBig5hkscsCodec::name() = \"big5hkscs-0\"");
return "big5hkscs-0";
}
int QFontBig5hkscsCodec::_mibEnum()
{
//qDebug("QFontBig5hkscsCodec::mibEnum() = -2101");
return -2101;
}
QString QFontBig5hkscsCodec::convertToUnicode(const char* /*chars*/, int /*len*/, ConverterState *) const
{
return QString();
}
QByteArray QFontBig5hkscsCodec::convertFromUnicode(const QChar *uc, int len, ConverterState *) const
{
//qDebug("QFontBig5hkscsCodec::fromUnicode(const QString& uc, int& lenInOut = %d)", lenInOut);
QByteArray result;
result.resize(len * 2);
uchar *rdata = (uchar *) result.data();
const QChar *ucp = uc;
for (int i = 0; i < len; i++) {
QChar ch(*ucp++);
uchar c[2];
#if 0
if (ch.row() == 0) {
if (ch.cell() == ' ')
ch = QChar(0x3000);
else if (ch.cell() > ' ' && ch.cell() < 127)
ch = QChar(ch.cell()-' ', 255);
}
#endif
if (qt_UnicodeToBig5hkscs(ch.unicode(), c) == 2) {
*rdata++ = c[0];
*rdata++ = c[1];
} else {
//white square
*rdata++ = 0;
*rdata++ = 0;
}
}
return result;
}
#endif // Q_OS_UNIX
/* ====================================================================== */
/*

View File

@ -92,42 +92,6 @@ public:
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
};
#ifdef Q_OS_UNIX
class Q_CORE_EXPORT QFontBig5Codec : public QTextCodec
{
public:
QFontBig5Codec();
static QByteArray _name();
static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
static int _mibEnum();
QByteArray name() const { return _name(); }
QList<QByteArray> aliases() const { return _aliases(); }
int mibEnum() const { return _mibEnum(); }
QString convertToUnicode(const char *, int, ConverterState *) const;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
};
class Q_CORE_EXPORT QFontBig5hkscsCodec : public QTextCodec
{
public:
QFontBig5hkscsCodec();
static QByteArray _name();
static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
static int _mibEnum();
QByteArray name() const { return _name(); }
QList<QByteArray> aliases() const { return _aliases(); }
int mibEnum() const { return _mibEnum(); }
QString convertToUnicode(const char *, int, ConverterState *) const;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
};
#endif // Q_OS_UNIX
#endif // QT_NO_BIG_CODECS
QT_END_NAMESPACE

View File

@ -189,54 +189,6 @@ QByteArray QEucKrCodec::_name()
}
#ifdef Q_OS_UNIX
QFontKsc5601Codec::QFontKsc5601Codec()
{
}
QByteArray QFontKsc5601Codec::_name()
{
return "ksc5601.1987-0";
}
int QFontKsc5601Codec::_mibEnum()
{
return 36;
}
QString QFontKsc5601Codec::convertToUnicode(const char*, int, ConverterState *) const
{
return QString();
}
QByteArray QFontKsc5601Codec::convertFromUnicode(const QChar *uc, int len, ConverterState *) const
{
QByteArray result;
result.resize(len * 2);
uchar *rdata = (uchar *) result.data();
const QChar *ucp = uc;
for (int i = 0; i < len; i++) {
QChar ch(*ucp++);
ch = qt_UnicodeToKsc5601(ch.unicode());
if (! ch.isNull()) {
*rdata++ = ch.row() & 0x7f ;
*rdata++ = ch.cell() & 0x7f;
} else {
//white square
*rdata++ = 0x21;
*rdata++ = 0x60;
}
}
return result;
}
#endif // Q_OS_UNIX
// code converter wrapper
static unsigned short ksc2unicode (unsigned short code);

View File

@ -113,26 +113,6 @@ public:
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
};
#ifdef Q_OS_UNIX
class QFontKsc5601Codec : public QTextCodec
{
public:
QFontKsc5601Codec();
static QByteArray _name();
static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
static int _mibEnum();
QByteArray name() const { return _name(); }
QList<QByteArray> aliases() const { return _aliases(); }
int mibEnum() const { return _mibEnum(); }
QString convertToUnicode(const char *, int, ConverterState *) const;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
};
#endif
#endif // QT_NO_BIG_CODECS
QT_END_NAMESPACE

View File

@ -1,149 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qfontjpcodec_p.h"
#include "qjpunicode_p.h"
QT_BEGIN_NAMESPACE
#ifndef QT_NO_BIG_CODECS
#ifdef Q_OS_UNIX
// JIS X 0201
QFontJis0201Codec::QFontJis0201Codec()
{
}
QByteArray QFontJis0201Codec::_name()
{
return "jisx0201*-0";
}
int QFontJis0201Codec::_mibEnum()
{
return 15;
}
QByteArray QFontJis0201Codec::convertFromUnicode(const QChar *uc, int len, ConverterState *) const
{
QByteArray rstring;
rstring.resize(len);
uchar *rdata = (uchar *) rstring.data();
const QChar *sdata = uc;
int i = 0;
for (; i < len; ++i, ++sdata, ++rdata) {
if (sdata->unicode() < 0x80) {
*rdata = (uchar) sdata->unicode();
} else if (sdata->unicode() >= 0xff61 && sdata->unicode() <= 0xff9f) {
*rdata = (uchar) (sdata->unicode() - 0xff61 + 0xa1);
} else {
*rdata = 0;
}
}
return rstring;
}
QString QFontJis0201Codec::convertToUnicode(const char *, int, ConverterState *) const
{
return QString();
}
// JIS X 0208
QFontJis0208Codec::QFontJis0208Codec()
{
convJP = QJpUnicodeConv::newConverter(QJpUnicodeConv::Default);
}
QFontJis0208Codec::~QFontJis0208Codec()
{
delete convJP;
convJP = 0;
}
QByteArray QFontJis0208Codec::_name()
{
return "jisx0208*-0";
}
int QFontJis0208Codec::_mibEnum()
{
return 63;
}
QString QFontJis0208Codec::convertToUnicode(const char* /*chars*/, int /*len*/, ConverterState *) const
{
return QString();
}
QByteArray QFontJis0208Codec::convertFromUnicode(const QChar *uc, int len, ConverterState *) const
{
QByteArray result;
result.resize(len * 2);
uchar *rdata = (uchar *) result.data();
const QChar *ucp = uc;
for (int i = 0; i < len; i++) {
QChar ch(*ucp++);
ch = convJP->unicodeToJisx0208(ch.unicode());
if (!ch.isNull()) {
*rdata++ = ch.row();
*rdata++ = ch.cell();
} else {
*rdata++ = 0;
*rdata++ = 0;
}
}
return result;
}
#endif
#endif // QT_NO_BIG_CODECS
QT_END_NAMESPACE

View File

@ -1,108 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QFONTJPCODEC_P_H
#define QFONTJPCODEC_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of other Qt classes. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#include <QtCore/qtextcodec.h>
#include <QtCore/qlist.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_BIG_CODECS
class QJpUnicodeConv;
#ifdef Q_OS_UNIX
class QFontJis0201Codec : public QTextCodec
{
public:
QFontJis0201Codec();
static QByteArray _name();
static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
static int _mibEnum();
QByteArray name() const { return _name(); }
QList<QByteArray> aliases() const { return _aliases(); }
int mibEnum() const { return _mibEnum(); }
QByteArray convertFromUnicode(const QChar *uc, int len, ConverterState *) const;
QString convertToUnicode(const char*, int, ConverterState *) const;
};
class QFontJis0208Codec : public QTextCodec
{
public:
QFontJis0208Codec();
~QFontJis0208Codec();
static QByteArray _name();
static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
static int _mibEnum();
QByteArray name() const { return _name(); }
QList<QByteArray> aliases() const { return _aliases(); }
int mibEnum() const { return _mibEnum(); }
QString convertToUnicode(const char* /*chars*/, int /*len*/, ConverterState *) const;
QByteArray convertFromUnicode(const QChar *uc, int len, ConverterState *) const;
private:
QJpUnicodeConv *convJP;
};
#endif
#endif // QT_NO_BIG_CODECS
QT_END_NAMESPACE
#endif // QFONTJPCODEC_P_H

View File

@ -1,121 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qfontlaocodec_p.h"
#include "qlist.h"
#ifndef QT_NO_BIG_CODECS
QT_BEGIN_NAMESPACE
static unsigned char const unicode_to_mulelao[256] =
{
// U+0E80
0x00, 0xa1, 0xa2, 0x00, 0xa4, 0x00, 0x00, 0xa7,
0xa8, 0x00, 0xaa, 0x00, 0x00, 0xad, 0x00, 0x00,
// U+0E90
0x00, 0x00, 0x00, 0x00, 0xb4, 0xb5, 0xb6, 0xb7,
0x00, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
// U+0EA0
0x00, 0xc1, 0xc2, 0xc3, 0x00, 0xc5, 0x00, 0xc7,
0x00, 0x00, 0xca, 0xcb, 0x00, 0xcd, 0xce, 0xcf,
// U+0EB0
0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
0xd8, 0xd9, 0x00, 0xdb, 0xdc, 0xdd, 0x00, 0x00,
// U+0EC0
0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0x00, 0xe6, 0x00,
0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0x00, 0x00,
// U+0ED0
0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
0xf8, 0xf9, 0x00, 0x00, 0xfc, 0xfd, 0x00, 0x00,
// U+0EE0
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
// U+0EF0
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
QFontLaoCodec::~QFontLaoCodec()
{
}
QByteArray QFontLaoCodec::name() const
{
return "mulelao-1";
}
int QFontLaoCodec::mibEnum() const
{
return -4242;
}
QString QFontLaoCodec::convertToUnicode(const char *, int, ConverterState *) const
{
return QString();
}
QByteArray QFontLaoCodec::convertFromUnicode(const QChar *uc, int len, ConverterState *) const
{
QByteArray rstring(len, Qt::Uninitialized);
uchar *rdata = (uchar *) rstring.data();
const QChar *sdata = uc;
int i = 0;
for (; i < len; ++i, ++sdata, ++rdata) {
if (sdata->unicode() < 0x80) {
*rdata = (uchar) sdata->unicode();
} else if (sdata->unicode() >= 0x0e80 && sdata->unicode() <= 0x0eff) {
uchar lao = unicode_to_mulelao[sdata->unicode() - 0x0e80];
if (lao)
*rdata = lao;
else
*rdata = 0;
} else {
*rdata = 0;
}
}
return rstring;
}
QT_END_NAMESPACE
#endif // QT_NO_BIG_CODECS

View File

@ -1,78 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QFONTLAOCODEC_P_H
#define QFONTLAOCODEC_P_H
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists for the convenience
// of qfontencodings_x11.cpp and qfont_x11.cpp. This header file may
// change from version to version without notice, or even be removed.
//
// We mean it.
//
#include "QtCore/qtextcodec.h"
QT_BEGIN_NAMESPACE
#ifndef QT_NO_BIG_CODECS
class Q_CORE_EXPORT QFontLaoCodec : public QTextCodec
{
public:
~QFontLaoCodec();
QByteArray name() const;
int mibEnum() const;
QString convertToUnicode(const char *, int, ConverterState *) const;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
};
#endif // QT_NO_BIG_CODECS
QT_END_NAMESPACE
#endif // QFONTLAOCODEC_P_H

View File

@ -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},

View File

@ -109,60 +109,6 @@ public:
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
};
#ifdef Q_OS_UNIX
class QFontGb2312Codec : public QTextCodec
{
public:
QFontGb2312Codec();
static QByteArray _name();
static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
static int _mibEnum();
QByteArray name() const { return _name(); }
int mibEnum() const { return _mibEnum(); }
QString convertToUnicode(const char *, int, ConverterState *) const;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
};
class QFontGbkCodec : public QTextCodec
{
public:
QFontGbkCodec();
static QByteArray _name();
static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
static int _mibEnum();
QByteArray name() const { return _name(); }
QList<QByteArray> aliases() const { return _aliases(); }
int mibEnum() const { return _mibEnum(); }
QString convertToUnicode(const char *, int, ConverterState *) const;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
};
class QFontGb18030_0Codec : public QTextCodec
{
public:
QFontGb18030_0Codec();
static QByteArray _name();
static QList<QByteArray> _aliases() { return QList<QByteArray>(); }
static int _mibEnum();
QByteArray name() const { return _name(); }
QList<QByteArray> aliases() const { return _aliases(); }
int mibEnum() const { return _mibEnum(); }
QString convertToUnicode(const char *, int, ConverterState *) const;
QByteArray convertFromUnicode(const QChar *, int, ConverterState *) const;
};
#endif // Q_OS_UNIX
#endif // QT_NO_BIG_CODECS
QT_END_NAMESPACE

View File

@ -71,10 +71,6 @@
# include "qeuckrcodec_p.h"
# include "qbig5codec_p.h"
# endif // !Q_OS_INTEGRITY
# ifdef Q_OS_UNIX
# include "qfontlaocodec_p.h"
# include "qfontjpcodec_p.h"
# endif
#endif // !QT_BOOTSTRAPPED && !QT_NO_BIG_CODECS
#include "qlocale.h"
#include "qmutex.h"
@ -672,17 +668,6 @@ static void setup()
(void)new QSimpleTextCodec(i);
# if !defined(QT_BOOTSTRAPPED) && !defined(QT_NO_BIG_CODECS)
# ifdef Q_OS_UNIX
(void)new QFontLaoCodec;
(void)new QFontGb2312Codec;
(void)new QFontGbkCodec;
(void)new QFontGb18030_0Codec;
(void)new QFontJis0208Codec;
(void)new QFontJis0201Codec;
(void)new QFontKsc5601Codec;
(void)new QFontBig5hkscsCodec;
(void)new QFontBig5Codec;
# endif // Q_OS_UNIX
# ifndef Q_OS_INTEGRITY
(void)new QGb18030Codec;