summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/codecs')
-rw-r--r--src/corelib/codecs/QBKCODEC_LICENSE.txt24
-rw-r--r--src/corelib/codecs/QEUCJPCODEC_LICENSE.txt22
-rw-r--r--src/corelib/codecs/QEUCKRCODEC_LICENSE.txt22
-rw-r--r--src/corelib/codecs/QJISCODEC_LICENSE.txt22
-rw-r--r--src/corelib/codecs/QSJISCODEC_LICENSE.txt22
-rw-r--r--src/corelib/codecs/QTSCIICODEC_LICENSE.txt22
-rw-r--r--src/corelib/codecs/codecs.pri28
-rw-r--r--src/corelib/codecs/codecs.qdoc249
-rw-r--r--src/corelib/codecs/cp949codetbl_p.h2
-rw-r--r--src/corelib/codecs/qbig5codec_p.h1
-rw-r--r--src/corelib/codecs/qeuckrcodec_p.h1
-rw-r--r--src/corelib/codecs/qgb18030codec_p.h1
-rw-r--r--src/corelib/codecs/qiconvcodec.cpp2
-rw-r--r--src/corelib/codecs/qiconvcodec_p.h7
-rw-r--r--src/corelib/codecs/qicucodec.cpp10
-rw-r--r--src/corelib/codecs/qicucodec_p.h2
-rw-r--r--src/corelib/codecs/qisciicodec_p.h1
-rw-r--r--src/corelib/codecs/qjiscodec.cpp2
-rw-r--r--src/corelib/codecs/qjpunicode_p.h2
-rw-r--r--src/corelib/codecs/qlatincodec_p.h1
-rw-r--r--src/corelib/codecs/qsimplecodec_p.h1
-rw-r--r--src/corelib/codecs/qt_attribution.json103
-rw-r--r--src/corelib/codecs/qtextcodec.cpp6
-rw-r--r--src/corelib/codecs/qtextcodec_p.h1
-rw-r--r--src/corelib/codecs/qtsciicodec_p.h1
-rw-r--r--src/corelib/codecs/qutfcodec.cpp87
-rw-r--r--src/corelib/codecs/qwindowscodec.cpp2
-rw-r--r--src/corelib/codecs/qwindowscodec_p.h1
28 files changed, 372 insertions, 273 deletions
diff --git a/src/corelib/codecs/QBKCODEC_LICENSE.txt b/src/corelib/codecs/QBKCODEC_LICENSE.txt
new file mode 100644
index 0000000000..1eb9e3b0d4
--- /dev/null
+++ b/src/corelib/codecs/QBKCODEC_LICENSE.txt
@@ -0,0 +1,24 @@
+Copyright (C) 2000 TurboLinux, Inc. Written by Justin Yu and Sean Chen.
+Copyright (C) 2001, 2002 Turbolinux, Inc. Written by James Su.
+Copyright (C) 2001, 2002 ThizLinux Laboratory Ltd. Written by Anthony Fok.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/src/corelib/codecs/QEUCJPCODEC_LICENSE.txt b/src/corelib/codecs/QEUCJPCODEC_LICENSE.txt
new file mode 100644
index 0000000000..b1754cf198
--- /dev/null
+++ b/src/corelib/codecs/QEUCJPCODEC_LICENSE.txt
@@ -0,0 +1,22 @@
+Copyright (C) 1999 Serika Kurusugawa, All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/src/corelib/codecs/QEUCKRCODEC_LICENSE.txt b/src/corelib/codecs/QEUCKRCODEC_LICENSE.txt
new file mode 100644
index 0000000000..81327f1bcb
--- /dev/null
+++ b/src/corelib/codecs/QEUCKRCODEC_LICENSE.txt
@@ -0,0 +1,22 @@
+Copyright (C) 1999-2000 Mizi Research Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/src/corelib/codecs/QJISCODEC_LICENSE.txt b/src/corelib/codecs/QJISCODEC_LICENSE.txt
new file mode 100644
index 0000000000..b1754cf198
--- /dev/null
+++ b/src/corelib/codecs/QJISCODEC_LICENSE.txt
@@ -0,0 +1,22 @@
+Copyright (C) 1999 Serika Kurusugawa, All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/src/corelib/codecs/QSJISCODEC_LICENSE.txt b/src/corelib/codecs/QSJISCODEC_LICENSE.txt
new file mode 100644
index 0000000000..b1754cf198
--- /dev/null
+++ b/src/corelib/codecs/QSJISCODEC_LICENSE.txt
@@ -0,0 +1,22 @@
+Copyright (C) 1999 Serika Kurusugawa, All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/src/corelib/codecs/QTSCIICODEC_LICENSE.txt b/src/corelib/codecs/QTSCIICODEC_LICENSE.txt
new file mode 100644
index 0000000000..c66ff21389
--- /dev/null
+++ b/src/corelib/codecs/QTSCIICODEC_LICENSE.txt
@@ -0,0 +1,22 @@
+Copyright (C) 2000 Hans Petter Bieker. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri
index bfb677e6fb..4fa778d042 100644
--- a/src/corelib/codecs/codecs.pri
+++ b/src/corelib/codecs/codecs.pri
@@ -17,7 +17,7 @@ SOURCES += \
codecs/qtsciicodec.cpp \
codecs/qutfcodec.cpp
-contains(QT_CONFIG,icu) {
+qtConfig(icu) {
HEADERS += \
codecs/qicucodec_p.h
SOURCES += \
@@ -40,23 +40,17 @@ contains(QT_CONFIG,icu) {
codecs/qeuckrcodec.cpp \
codecs/qbig5codec.cpp
- unix:!qnx:!mac:!ios:!linux-android-* {
- contains(QT_CONFIG,iconv) {
- HEADERS += codecs/qiconvcodec_p.h
- SOURCES += codecs/qiconvcodec.cpp
- } else:contains(QT_CONFIG,gnu-libiconv) {
- HEADERS += codecs/qiconvcodec_p.h
- SOURCES += codecs/qiconvcodec.cpp
- DEFINES += GNU_LIBICONV
- LIBS_PRIVATE *= -liconv
- } else:contains(QT_CONFIG,sun-libiconv) {
- HEADERS += codecs/qiconvcodec_p.h
- SOURCES += codecs/qiconvcodec.cpp
- DEFINES += GNU_LIBICONV
- }
- } else:!win32-msvc* {
- DEFINES += QT_NO_ICONV
+ qtConfig(iconv) {
+ HEADERS += codecs/qiconvcodec_p.h
+ SOURCES += codecs/qiconvcodec.cpp
+ qtConfig(gnu-libiconv) {
+ DEFINES += GNU_LIBICONV
+ QMAKE_USE_PRIVATE += iconv
+ } else: qtConfig(sun-libiconv) {
+ DEFINES += GNU_LIBICONV
+ }
}
+
win32 {
SOURCES += codecs/qwindowscodec.cpp
HEADERS += codecs/qwindowscodec_p.h
diff --git a/src/corelib/codecs/codecs.qdoc b/src/corelib/codecs/codecs.qdoc
index e0f1c9b060..9364b7a989 100644
--- a/src/corelib/codecs/codecs.qdoc
+++ b/src/corelib/codecs/codecs.qdoc
@@ -55,35 +55,7 @@
\<anthony@thizlinux.com\> \<foka@debian.org\> to adapt the code
for Qt.
- \legalese
- Copyright (C) 2000 Ming-Che Chuang
- Copyright (C) 2002 James Su, Turbolinux Inc.
- Copyright (C) 2002 Anthony Fok, ThizLinux Laboratory Ltd.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- \list 1
- \li Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- \li Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- \endlist
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
- \endlegalese
+ \sa{Text Codecs: Big5, Big5-HKSCS}
*/
/*!
@@ -124,36 +96,7 @@
Li18nux Big5 Standard Subgroup. See \l{http://www.autrijus.org/xml/}
for the various Big5 CharMapML tables.
- \legalese
- Copyright (C) 2000 Ming-Che Chuang
- Copyright (C) 2001, 2002 James Su, Turbolinux Inc.
- Copyright (C) 2002 WU Yi, HancomLinux Inc.
- Copyright (C) 2001, 2002 Anthony Fok, ThizLinux Laboratory Ltd.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- \list 1
- \li Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- \li Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- \endlist
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
- \endlegalese
+ \sa{Text Codecs: Big5, Big5-HKSCS}
*/
/*!
@@ -171,37 +114,9 @@
Most of the code here was written by Serika Kurusugawa,
a.k.a. Junji Takagi, and is included in Qt with the author's
- permission and the grateful thanks of the Qt team. Here is
- the copyright statement for that code:
-
- \legalese
-
- Copyright (C) 1999 Serika Kurusugawa. All rights reserved.
+ permission and the grateful thanks of the Qt team.
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- \list 1
- \li Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- \li Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- \endlist
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS".
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
- \endlegalese
+ \sa{Text Codec: EUC-JP}
*/
/*!
@@ -217,34 +132,7 @@
contribution. The subsequent modifications are covered by
the usual copyright for Qt.
- \legalese
-
- Copyright (C) 1999-2000 Mizi Research Inc. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- \list 1
- \li Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- \li Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- \endlist
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
- \endlegalese
+ \sa{Text Codec: EUC-KR}
*/
/*!
@@ -292,37 +180,7 @@
A copy of the source Perl script is available at
\l{http://people.debian.org/~foka/gb18030/gen-qgb18030codec.pl}
- The copyright notice for their code follows:
-
- \legalese
- Copyright (C) 2000 TurboLinux, Inc. Written by Justin Yu and Sean Chen.
- Copyright (C) 2001, 2002 Turbolinux, Inc. Written by James Su.
- Copyright (C) 2001, 2002 ThizLinux Laboratory Ltd. Written by Anthony Fok.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- \list 1
- \li Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- \li Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- \endlist
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
- \endlegalese
+ \sa{Text Codec: GBK}
*/
/*!
@@ -381,37 +239,9 @@
Most of the code here was written by Serika Kurusugawa,
a.k.a. Junji Takagi, and is included in Qt with the author's
- permission and the grateful thanks of the Qt team. Here is
- the copyright statement for that code:
-
- \legalese
+ permission and the grateful thanks of the Qt team.
- Copyright (C) 1999 Serika Kurusugawa. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- \list 1
- \li Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- \li Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- \endlist
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS".
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
- \endlegalese
+ \sa{Text Codec: ISO 2022-JP (JIS)}
*/
/*!
@@ -433,34 +263,7 @@
contribution. The subsequent modifications are covered by
the usual copyright for Qt.
- \legalese
-
- Copyright (C) 1999 Serika Kurusugawa. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- \list 1
- \li Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- \li Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- \endlist
-
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS".
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
- \endlegalese
+ \sa{Text Codec: Shift-JIS}
*/
/*!
@@ -483,37 +286,7 @@
Most of the code was written by Hans Petter Bieker and is
included in Qt with the author's permission and the grateful
- thanks of the Qt team. Here is the copyright statement for
- the code as it was at the point of contribution. The
- subsequent modifications are covered by the usual copyright for
- Qt:
-
- \legalese
-
- Copyright (c) 2000 Hans Petter Bieker. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- \list 1
- \li Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- \li Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- \endlist
+ thanks of the Qt team.
- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
- \endlegalese
+ \sa{Text Codec: TSCII}
*/
diff --git a/src/corelib/codecs/cp949codetbl_p.h b/src/corelib/codecs/cp949codetbl_p.h
index 3d55bcfac9..3b615d4e17 100644
--- a/src/corelib/codecs/cp949codetbl_p.h
+++ b/src/corelib/codecs/cp949codetbl_p.h
@@ -51,6 +51,8 @@
// We mean it.
//
+#include <QtCore/private/qglobal_p.h>
+
static const unsigned short cp949_icode_to_unicode[] = {
0xac02, 0xac03, 0xac05, 0xac06, 0xac0b, 0xac0c, 0xac0d, 0xac0e, 0xac0f, 0xac18, 0xac1e, 0xac1f, 0xac21, 0xac22, 0xac23,
0xac25, 0xac26, 0xac27, 0xac28, 0xac29, 0xac2a, 0xac2b, 0xac2e, 0xac32, 0xac33, 0xac34, 0xac35, 0xac36, 0xac37, 0xac3a,
diff --git a/src/corelib/codecs/qbig5codec_p.h b/src/corelib/codecs/qbig5codec_p.h
index 24a520a119..9dbcf41a6d 100644
--- a/src/corelib/codecs/qbig5codec_p.h
+++ b/src/corelib/codecs/qbig5codec_p.h
@@ -55,6 +55,7 @@
// We mean it.
//
+#include <QtCore/private/qglobal_p.h>
#include <QtCore/qtextcodec.h>
#include <QtCore/qlist.h>
diff --git a/src/corelib/codecs/qeuckrcodec_p.h b/src/corelib/codecs/qeuckrcodec_p.h
index 0311fb689c..2cf950a350 100644
--- a/src/corelib/codecs/qeuckrcodec_p.h
+++ b/src/corelib/codecs/qeuckrcodec_p.h
@@ -76,6 +76,7 @@
// We mean it.
//
+#include <QtCore/private/qglobal_p.h>
#include <QtCore/qtextcodec.h>
#include <QtCore/qlist.h>
diff --git a/src/corelib/codecs/qgb18030codec_p.h b/src/corelib/codecs/qgb18030codec_p.h
index 3884eea6fd..dd136aeddb 100644
--- a/src/corelib/codecs/qgb18030codec_p.h
+++ b/src/corelib/codecs/qgb18030codec_p.h
@@ -53,6 +53,7 @@
// We mean it.
//
+#include <QtCore/private/qglobal_p.h>
#include <QtCore/qtextcodec.h>
#include <QtCore/qlist.h>
diff --git a/src/corelib/codecs/qiconvcodec.cpp b/src/corelib/codecs/qiconvcodec.cpp
index 96f1ee16ac..845155dce0 100644
--- a/src/corelib/codecs/qiconvcodec.cpp
+++ b/src/corelib/codecs/qiconvcodec.cpp
@@ -411,7 +411,7 @@ QByteArray QIconvCodec::convertFromUnicode(const QChar *uc, int len, ConverterSt
switch (errno) {
case EILSEQ:
++invalidCount;
- // fall through
+ Q_FALLTHROUGH();
case EINVAL:
{
inBytes += sizeof(QChar);
diff --git a/src/corelib/codecs/qiconvcodec_p.h b/src/corelib/codecs/qiconvcodec_p.h
index 4c7f7084e6..238351bc81 100644
--- a/src/corelib/codecs/qiconvcodec_p.h
+++ b/src/corelib/codecs/qiconvcodec_p.h
@@ -44,13 +44,14 @@
// W A R N I N G
// -------------
//
-// This file is not part of the Qt API. It exists for the convenience
-// of the QLibrary class. This header file may change from
-// version to version without notice, or even be removed.
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
//
// We mean it.
//
+#include <QtCore/private/qglobal_p.h>
#include "qtextcodec.h"
#if defined(Q_OS_UNIX) && !defined(QT_NO_ICONV) && !defined(QT_BOOTSTRAPPED)
diff --git a/src/corelib/codecs/qicucodec.cpp b/src/corelib/codecs/qicucodec.cpp
index aa2095d9da..ee9f1d0048 100644
--- a/src/corelib/codecs/qicucodec.cpp
+++ b/src/corelib/codecs/qicucodec.cpp
@@ -527,7 +527,7 @@ QTextCodec *QIcuCodec::codecForNameUnlocked(const char *name)
// check whether there is really a converter for the name available.
UConverter *conv = ucnv_open(standardName, &error);
if (!conv) {
- qDebug() << "codecForName: ucnv_open failed" << standardName << u_errorName(error);
+ qDebug("codecForName: ucnv_open failed %s %s", standardName, u_errorName(error));
return 0;
}
//qDebug() << "QIcuCodec: Standard name for " << name << "is" << standardName;
@@ -577,7 +577,7 @@ UConverter *QIcuCodec::getConverter(QTextCodec::ConverterState *state) const
ucnv_setSubstChars(static_cast<UConverter *>(state->d),
state->flags & QTextCodec::ConvertInvalidToNull ? "\0" : "?", 1, &error);
if (U_FAILURE(error))
- qDebug() << "getConverter(state) ucnv_open failed" << m_name << u_errorName(error);
+ qDebug("getConverter(state) ucnv_open failed %s %s", m_name, u_errorName(error));
}
conv = static_cast<UConverter *>(state->d);
}
@@ -587,7 +587,7 @@ UConverter *QIcuCodec::getConverter(QTextCodec::ConverterState *state) const
conv = ucnv_open(m_name, &error);
ucnv_setSubstChars(conv, "?", 1, &error);
if (U_FAILURE(error))
- qDebug() << "getConverter(no state) ucnv_open failed" << m_name << u_errorName(error);
+ qDebug("getConverter(no state) ucnv_open failed %s %s", m_name, u_errorName(error));
}
return conv;
}
@@ -610,7 +610,7 @@ QString QIcuCodec::convertToUnicode(const char *chars, int length, QTextCodec::C
&chars, end,
0, false, &error);
if (!U_SUCCESS(error) && error != U_BUFFER_OVERFLOW_ERROR) {
- qDebug() << "convertToUnicode failed:" << u_errorName(error);
+ qDebug("convertToUnicode failed: %s", u_errorName(error));
break;
}
@@ -647,7 +647,7 @@ QByteArray QIcuCodec::convertFromUnicode(const QChar *unicode, int length, QText
&uc, end,
0, false, &error);
if (!U_SUCCESS(error))
- qDebug() << "convertFromUnicode failed:" << u_errorName(error);
+ qDebug("convertFromUnicode failed: %s", u_errorName(error));
convertedChars = ch - string.data();
if (uc >= end)
break;
diff --git a/src/corelib/codecs/qicucodec_p.h b/src/corelib/codecs/qicucodec_p.h
index a277529dc4..3a373ce5b3 100644
--- a/src/corelib/codecs/qicucodec_p.h
+++ b/src/corelib/codecs/qicucodec_p.h
@@ -53,6 +53,8 @@
// We mean it.
//
+#include <QtCore/private/qglobal_p.h>
+
extern "C" {
typedef struct UConverter UConverter;
}
diff --git a/src/corelib/codecs/qisciicodec_p.h b/src/corelib/codecs/qisciicodec_p.h
index 94a3171d7d..f92c0091ce 100644
--- a/src/corelib/codecs/qisciicodec_p.h
+++ b/src/corelib/codecs/qisciicodec_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtCore/private/qglobal_p.h>
#include "QtCore/qtextcodec.h"
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/codecs/qjiscodec.cpp b/src/corelib/codecs/qjiscodec.cpp
index 9c628c6012..a8625db054 100644
--- a/src/corelib/codecs/qjiscodec.cpp
+++ b/src/corelib/codecs/qjiscodec.cpp
@@ -288,7 +288,7 @@ QString QJisCodec::convertToUnicode(const char* chars, int len, ConverterState *
result += QLatin1Char(ch);
break;
}
- /* fall through */
+ Q_FALLTHROUGH();
case JISX0201_Latin:
u = conv->jisx0201ToUnicode(ch);
result += QValidChar(u);
diff --git a/src/corelib/codecs/qjpunicode_p.h b/src/corelib/codecs/qjpunicode_p.h
index 104f540b66..4fa2b9f757 100644
--- a/src/corelib/codecs/qjpunicode_p.h
+++ b/src/corelib/codecs/qjpunicode_p.h
@@ -80,7 +80,7 @@
// We mean it.
//
-#include <QtCore/qglobal.h>
+#include <QtCore/private/qglobal_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/codecs/qlatincodec_p.h b/src/corelib/codecs/qlatincodec_p.h
index b3556a411a..1042c3b80d 100644
--- a/src/corelib/codecs/qlatincodec_p.h
+++ b/src/corelib/codecs/qlatincodec_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtCore/private/qglobal_p.h>
#include "QtCore/qtextcodec.h"
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/codecs/qsimplecodec_p.h b/src/corelib/codecs/qsimplecodec_p.h
index d45cf2377f..d268a9f5b8 100644
--- a/src/corelib/codecs/qsimplecodec_p.h
+++ b/src/corelib/codecs/qsimplecodec_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtCore/private/qglobal_p.h>
#include "QtCore/qtextcodec.h"
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/codecs/qt_attribution.json b/src/corelib/codecs/qt_attribution.json
new file mode 100644
index 0000000000..41f644a030
--- /dev/null
+++ b/src/corelib/codecs/qt_attribution.json
@@ -0,0 +1,103 @@
+[
+ {
+ "Id": "qbig5codecs",
+ "Name": "Text Codecs: Big5, Big5-HKSCS",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core if ICU is not used. Configure with -icu to avoid.",
+ "Path": "qbig5codec.cpp",
+
+ "Description": "The Big5 codecs (QBig5Codec, QBig5hkscsCodec)
+provide conversion to and from the Big5 encodings.",
+ "License": "BSD 2-clause \"Simplified\" License",
+ "LicenseId": "BSD-2-Clause",
+ "LicenseFile": "QBIG5CODEC_LICENSE.txt",
+ "Copyright": "Copyright (C) 2000 Ming-Che Chuang
+Copyright (C) 2001, 2002 James Su, Turbolinux Inc.
+Copyright (C) 2002 WU Yi, HancomLinux Inc.
+Copyright (C) 2001, 2002 Anthony Fok, ThizLinux Laboratory Ltd."
+},
+ {
+ "Id": "qeucjpcodec",
+ "Name": "Text Codec: EUC-JP",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core if ICU is not used. Configure with -icu to avoid.",
+ "Path": "qeucjpcodec.cpp",
+
+ "Description": "The EUC-JP text codec provides conversion to and from EUC-JP,
+the main legacy encoding for Unix machines in Japan.",
+ "License": "BSD 2-clause \"Simplified\" License",
+ "LicenseId": "BSD-2-Clause",
+ "LicenseFile": "QEUCJPCODEC_LICENSE.txt",
+ "Copyright": "Copyright (C) 1999 Serika Kurusugawa."
+ },
+ {
+ "Id": "qeuckrcodec",
+ "Name": "Text Codec: EUC-KR",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core if ICU is not used. Configure with -icu to avoid.",
+ "Path": "qeuckrcodec.cpp",
+
+ "Description": "The EUC-KR text codec provides conversion to and from EUC-KR, KR,
+the main legacy encoding for Unix machines in Korea.",
+ "License": "BSD 2-clause \"Simplified\" License",
+ "LicenseId": "BSD-2-Clause",
+ "LicenseFile": "QEUCKRCODEC_LICENSE.txt",
+ "Copyright": "Copyright (C) 1999-2000 Mizi Research Inc."
+ },
+ {
+ "Id": "qjiscodec",
+ "Name": "Text Codec: ISO 2022-JP (JIS)",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core if ICU is not used. Configure with -icu to avoid.",
+ "Path": "qjiscodec.cpp",
+
+ "Description": "The ISO 2022-JP (JIS) text codec provides conversion to and from ISO 2022-JP.",
+ "License": "BSD 2-clause \"Simplified\" License",
+ "LicenseId": "BSD-2-Clause",
+ "LicenseFile": "QJISCODEC_LICENSE.txt",
+ "Copyright": "Copyright (C) 1999 Serika Kurusugawa."
+ },
+ {
+ "Id": "qsjiscodec",
+ "Name": "Text Codec: Shift-JIS",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core if ICU is not used. Configure with -icu to avoid.",
+ "Path": "qsjiscodec.cpp",
+
+ "Description": "The Shift-JIS text codec provides conversion to and from Shift-JIS.",
+ "License": "BSD 2-clause \"Simplified\" License",
+ "LicenseId": "BSD-2-Clause",
+ "LicenseFile": "QSJISCODEC_LICENSE.txt",
+ "Copyright": "Copyright (C) 1999 Serika Kurusugawa."
+ },
+ {
+ "Id": "qtsciicodec",
+ "Name": "Text Codec: TSCII",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core.",
+ "Path": "qtsciicodec.cpp",
+
+ "Description": "The TSCII text codec provides conversion to and from the Tamil TSCII
+encoding.",
+ "License": "BSD 2-clause \"Simplified\" License",
+ "LicenseId": "BSD-2-Clause",
+ "LicenseFile": "QTSCIICODEC_LICENSE.txt",
+ "Copyright": "Copyright (C) 2000 Hans Petter Bieker."
+ },
+ {
+ "Id": "qbkcodec",
+ "Name": "Text Codec: GBK",
+ "QDocModule": "qtcore",
+ "QtUsage": "Used in Qt Core if ICU is not used. Configure with -icu to avoid.",
+ "Path": "qgb18030codec.cpp",
+
+ "Description": "The GBK codec provides conversion to and from the Chinese
+GB18030/GBK/GB2312 encoding.",
+ "License": "BSD 2-clause \"Simplified\" License",
+ "LicenseId": "BSD-2-Clause",
+ "LicenseFile": "QBKCODEC_LICENSE.txt",
+ "Copyright": "Copyright (C) 2000 TurboLinux, Inc. Written by Justin Yu and Sean Chen.
+Copyright (C) 2001, 2002 Turbolinux, Inc. Written by James Su.
+Copyright (C) 2001, 2002 ThizLinux Laboratory Ltd. Written by Anthony Fok."
+ }
+]
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index edb03af447..5098ac4242 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -132,7 +132,7 @@ bool qTextCodecNameMatch(const char *n, const char *h)
}
-#if !defined(Q_OS_WIN32) && !defined(Q_OS_WINCE) && !defined(QT_LOCALE_IS_UTF8)
+#if !defined(Q_OS_WIN32) && !defined(QT_LOCALE_IS_UTF8)
static QTextCodec *checkForCodec(const QByteArray &name) {
QTextCodec *c = QTextCodec::codecForName(name);
if (!c) {
@@ -169,7 +169,7 @@ static QTextCodec *setupLocaleMapper()
#if defined(QT_LOCALE_IS_UTF8)
locale = QTextCodec::codecForName("UTF-8");
-#elif defined(Q_OS_WIN) || defined(Q_OS_WINCE)
+#elif defined(Q_OS_WIN)
locale = QTextCodec::codecForName("System");
#else
@@ -289,7 +289,7 @@ static void setup()
#if !defined(QT_NO_ICONV)
(void) new QIconvCodec;
#endif
-#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
+#if defined(Q_OS_WIN32)
(void) new QWindowsLocalCodec;
#endif // Q_OS_WIN32
#endif // !QT_NO_CODECS && !QT_BOOTSTRAPPED
diff --git a/src/corelib/codecs/qtextcodec_p.h b/src/corelib/codecs/qtextcodec_p.h
index ad05d01b90..f3c2d090c9 100644
--- a/src/corelib/codecs/qtextcodec_p.h
+++ b/src/corelib/codecs/qtextcodec_p.h
@@ -51,6 +51,7 @@
// We mean it.
//
+#include <QtCore/private/qglobal_p.h>
#include "qtextcodec.h"
#include <string.h>
diff --git a/src/corelib/codecs/qtsciicodec_p.h b/src/corelib/codecs/qtsciicodec_p.h
index 6beb22cf6a..68ab01f7b5 100644
--- a/src/corelib/codecs/qtsciicodec_p.h
+++ b/src/corelib/codecs/qtsciicodec_p.h
@@ -80,6 +80,7 @@
// We mean it.
//
+#include <QtCore/private/qglobal_p.h>
#include "QtCore/qtextcodec.h"
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp
index f1054ceb98..74a716db4a 100644
--- a/src/corelib/codecs/qutfcodec.cpp
+++ b/src/corelib/codecs/qutfcodec.cpp
@@ -52,6 +52,19 @@ enum { Endian = 0, Data = 1 };
static const uchar utf8bom[] = { 0xef, 0xbb, 0xbf };
+#if (defined(__SSE2__) && defined(QT_COMPILER_SUPPORTS_SSE2)) \
+ || (defined(__ARM_NEON__) && defined(Q_PROCESSOR_ARM_64))
+static Q_ALWAYS_INLINE uint qBitScanReverse(unsigned v) Q_DECL_NOTHROW
+{
+ uint result = qCountLeadingZeroBits(v);
+ // Now Invert the result: clz will count *down* from the msb to the lsb, so the msb index is 31
+ // and the lsb index is 0. The result for _bit_scan_reverse is expected to be the index when
+ // counting up: msb index is 0 (because it starts there), and the lsb index is 31.
+ result ^= sizeof(unsigned) * 8 - 1;
+ return result;
+}
+#endif
+
#if defined(__SSE2__) && defined(QT_COMPILER_SUPPORTS_SSE2)
static inline bool simdEncodeAscii(uchar *&dst, const ushort *&nextAscii, const ushort *&src, const ushort *end)
{
@@ -81,9 +94,9 @@ static inline bool simdEncodeAscii(uchar *&dst, const ushort *&nextAscii, const
// find the next probable ASCII character
// we don't want to load 32 bytes again in this loop if we know there are non-ASCII
// characters still coming
- nextAscii = src + _bit_scan_reverse(n) + 1;
+ nextAscii = src + qBitScanReverse(n) + 1;
- n = _bit_scan_forward(n);
+ n = qCountTrailingZeroBits(n);
dst += n;
src += n;
return false;
@@ -132,13 +145,81 @@ static inline bool simdDecodeAscii(ushort *&dst, const uchar *&nextAscii, const
// find the next probable ASCII character
// we don't want to load 16 bytes again in this loop if we know there are non-ASCII
// characters still coming
- n = _bit_scan_reverse(n);
+ n = qBitScanReverse(n);
nextAscii = src + (n / BitSpacing) + 1;
return false;
}
return src == end;
}
+#elif defined(__ARM_NEON__) && defined(Q_PROCESSOR_ARM_64) // vaddv is only available on Aarch64
+static inline bool simdEncodeAscii(uchar *&dst, const ushort *&nextAscii, const ushort *&src, const ushort *end)
+{
+ uint16x8_t maxAscii = vdupq_n_u16(0x7f);
+ uint16x8_t mask1 = { 1, 1 << 2, 1 << 4, 1 << 6, 1 << 8, 1 << 10, 1 << 12, 1 << 14 };
+ uint16x8_t mask2 = vshlq_n_u16(mask1, 1);
+
+ // do sixteen characters at a time
+ for ( ; end - src >= 16; src += 16, dst += 16) {
+ // load 2 lanes (or: "load interleaved")
+ uint16x8x2_t in = vld2q_u16(src);
+
+ // check if any of the elements > 0x7f, select 1 bit per element (element 0 -> bit 0, element 1 -> bit 1, etc),
+ // add those together into a scalar, and merge the scalars.
+ uint16_t nonAscii = vaddvq_u16(vandq_u16(vcgtq_u16(in.val[0], maxAscii), mask1))
+ | vaddvq_u16(vandq_u16(vcgtq_u16(in.val[1], maxAscii), mask2));
+
+ // merge the two lanes by shifting the values of the second by 8 and inserting them
+ uint16x8_t out = vsliq_n_u16(in.val[0], in.val[1], 8);
+
+ // store, even if there are non-ASCII characters here
+ vst1q_u8(dst, vreinterpretq_u8_u16(out));
+
+ if (nonAscii) {
+ // find the next probable ASCII character
+ // we don't want to load 32 bytes again in this loop if we know there are non-ASCII
+ // characters still coming
+ nextAscii = src + qBitScanReverse(nonAscii) + 1;
+
+ nonAscii = qCountTrailingZeroBits(nonAscii);
+ dst += nonAscii;
+ src += nonAscii;
+ return false;
+ }
+ }
+ return src == end;
+}
+
+static inline bool simdDecodeAscii(ushort *&dst, const uchar *&nextAscii, const uchar *&src, const uchar *end)
+{
+ // do eight characters at a time
+ uint8x8_t msb_mask = vdup_n_u8(0x80);
+ uint8x8_t add_mask = { 1, 1 << 1, 1 << 2, 1 << 3, 1 << 4, 1 << 5, 1 << 6, 1 << 7 };
+ for ( ; end - src >= 8; src += 8, dst += 8) {
+ uint8x8_t c = vld1_u8(src);
+ uint8_t n = vaddv_u8(vand_u8(vcge_u8(c, msb_mask), add_mask));
+ if (!n) {
+ // store
+ vst1q_u16(dst, vmovl_u8(c));
+ continue;
+ }
+
+ // copy the front part that is still ASCII
+ while (!(n & 1)) {
+ *dst++ = *src++;
+ n >>= 1;
+ }
+
+ // find the next probable ASCII character
+ // we don't want to load 16 bytes again in this loop if we know there are non-ASCII
+ // characters still coming
+ n = qBitScanReverse(n);
+ nextAscii = src + n + 1;
+ return false;
+
+ }
+ return src == end;
+}
#else
static inline bool simdEncodeAscii(uchar *, const ushort *, const ushort *, const ushort *)
{
diff --git a/src/corelib/codecs/qwindowscodec.cpp b/src/corelib/codecs/qwindowscodec.cpp
index b802ab7249..813d3c8153 100644
--- a/src/corelib/codecs/qwindowscodec.cpp
+++ b/src/corelib/codecs/qwindowscodec.cpp
@@ -157,7 +157,7 @@ QString QWindowsLocalCodec::convertToUnicodeCharByChar(const char *chars, int le
state->remainingChars = 0;
}
const char *mb = mbcs;
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
+#if !defined(Q_OS_WINRT)
const char *next = 0;
QString s;
while ((next = CharNextExA(CP_ACP, mb, 0)) != mb) {
diff --git a/src/corelib/codecs/qwindowscodec_p.h b/src/corelib/codecs/qwindowscodec_p.h
index 529c621b2e..2fd3c35378 100644
--- a/src/corelib/codecs/qwindowscodec_p.h
+++ b/src/corelib/codecs/qwindowscodec_p.h
@@ -50,6 +50,7 @@
// We mean it.
//
+#include <QtCore/private/qglobal_p.h>
#include "qtextcodec.h"
QT_BEGIN_NAMESPACE