summaryrefslogtreecommitdiffstats
path: root/src/corelib/codecs
Commit message (Collapse)AuthorAgeFilesLines
* Fix regression when pasting into QTextEdit from Firefox.Mitch Curtis2013-05-231-1/+3
| | | | | | | | | | Return the codec if one was found by QTextCodec::codecForUtfText, instead of returning the default (UTF-8). Task-number: QTBUG-31293 Change-Id: I95e3260376c00537006b7fbfdc3df5850e1ba657 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-163-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Introducing the Qt Android portPaul Olav Tvete2013-03-052-2/+2
| | | | | | | | | | | | | | | | | | | | | Based on the Necessitas project by Bogdan Vatra. Contributors to the Qt5 project: BogDan Vatra <bogdan@kde.org> Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> hjk <hjk121@nokiamail.com> Oswald Buddenhagen <oswald.buddenhagen@digia.com> Paul Olav Tvete <paul.tvete@digia.com> Robin Burchell <robin+qt@viroteck.net> Samuel Rødal <samuel.rodal@digia.com> Yoann Lopes <yoann.lopes@digia.com> The full history of the Qt5 port can be found in refs/old-heads/android, SHA-1 249ca9ca2c7d876b91b31df9434dde47f9065d0d Change-Id: Iff1a7b2dbb707c986f2639e65e39ed8f22430120 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add ISO 8859-11 as an alias for TIS-620David Faure2013-02-271-1/+2
| | | | | | | | | | | (qsimplecodec.cpp says so, but is unused when ICU is used) ISO 8859-16 is still missing though... Change-Id: Idbccedd7bad63f9788cec2f7fc1bbfcb7a891acc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Correctly detect HTML 5 charset attribute in QTextCodec::codecForHtml()Mitch Curtis2013-02-121-15/+17
| | | | | | | | | | | | | | | | | | | | | | | | | QTextCodec::codecForHtml currently fails to detect the charset for this HTML: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=9,chrome=1"> <title>Test</title> </head> This patch makes the detection of charsets more flexible, allowing for the use of the HTML 5 charset attribute as well more terminator characters ("'", and ">"). I also added a *_data function for the unit tests. Task-number: QTBUG-5451 Change-Id: I69fe4a04582f0d845cbbe9140a86a950fb7dc861 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Fix QTextCodec race.David Faure2013-01-221-2/+5
| | | | | | | | | The aliases for the TIS-620 codec were not available before loading it. This led to the following intermittent failure: QWARN : tst_QTextCodec::threadSafety() WARNING "MS874" not found? Change-Id: I8ed037d3238c04e1d35ed49e833ac01b7501d3e8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-1835-35/+35
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Delete codecs pageLars Knoll2012-11-261-11/+0
| | | | | | | | Unused and empty. QTextCodec and the Unicode overview contains all relevant information. Change-Id: I779ba4dea69a88802e34541e4ba44215b5d69c2a Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* fix wrong comment about #ifdef's endPeter Kümmel2012-11-261-1/+1
| | | | | | Change-Id: I8a627c01ced1163e3ea72e9e2b1b55da04ca91b2 Reviewed-by: Tasuku Suzuki <stasuku@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Enable module build with QT_NO_CODECSTasuku Suzuki2012-11-261-0/+2
| | | | | | Change-Id: I27239384a7676a81495a9d3f7484975d2f277e8c Reviewed-by: Peter Kümmel <syntheticpp@gmx.net> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Doc: Removed annotated list in Qt Core's group pages.Jerome Pasion2012-11-251-1/+0
| | | | | | | | | The annotatedlist commands are not needed as QDoc automatically generates the group members. Change-Id: I462bb65bd5f29c1761799d3d60acab0bd4886075 Reviewed-by: Christian Stromme <christian.stromme@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* QTscii and QIscii are not big codecsPeter Kümmel2012-11-034-7/+7
| | | | | | | This fixes the build when QT_NO_BIG_CODECS is defined. Change-Id: I832fb8ba5df6c4a6c1db9bdaecc498690357a56a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Qt Core: Adding a landing page and sorted the documentation.Jerome Pasion2012-10-261-3/+3
| | | | | | | | -Added \annotatedlist for the groups -Sorted and placed the pages on the index page. Change-Id: Id1a4344c0b39f00036f5ac29b1fcb869d5602d2b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Avoid warnings about an unreachable codeKonstantin Ritt2012-10-101-2/+2
| | | | | Change-Id: I57c2967db4c1bd2c39ecb3eac9b18eb7455c6a50 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2235-830/+830
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Exclude QIcuCodec when QT_NO_TEXTCODEC is definedJ-P Nurmi2012-09-162-0/+8
| | | | | | | Change-Id: Iec0178c427abcc1c79e4fe6ef449d399ac8ca363 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* checkForCodecs is not used when QT_LOCALE_IS_UTF8 is definedJiang Jiang2012-09-021-1/+1
| | | | | | Change-Id: I3d82863cbd123dbf73eb8f5721ef9294e6365de6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Force QT_NO_ICONV on win32:!win32-msvc*Lukas Geyer2012-08-311-1/+1
| | | | | | | | | | | | This behaviour was changed in Ide9800f6 to suppress macro redefinition warnings for MSVC, but MinGW has iconv support and therefore configure does not set QT_NO_ICONV, which prevents compilation on win32-g++ as QIconvCodec does not support Windows. Change-Id: Ic3c4ccceb3eaf9542c95b0c27847ca5ab51849b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
* Don't define QT_NO_ICONV on Windows: that comes from qconfig.hThiago Macieira2012-08-251-1/+1
| | | | | | | | | | | | Both the configure script and configure.exe add QT_NO_ICONV to qconfig.h in case they can't find iconv. Since Windows doesn't use iconv anyway, we don't need to set QT_NO_ICONV here. MSVC likes to print a warning that a macro is redefined. That gets quite spammy... Change-Id: Ide9800f6f848bc0c2d8bdbcb41875a709d3e249c Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Doc: Add \inmodule QtCore to all QtCore class doc bodiesThiago Macieira2012-08-239-0/+14
| | | | | Change-Id: I19100755c97cc155c76a859e19940e9f9222d34e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* ICU: Fix crash in codecForMib(2107)Kai Koehne2012-08-231-0/+4
| | | | | | | | | | | | availableMibs() unconditionally adds 2107 to the list of mibs. The patch ensures that codecForMib() also knows about this special TSCII codec. (Note that the autotest only really checks this code path if only this test case is run. The other tests already fill the internal codec cache otherwise). Change-Id: Id987d7cecd5f5700cca75e9b85b37011f8e5c622 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Make the "\internal" qdoc command stand on its own lineLaszlo Papp2012-08-153-24/+70
| | | | | | | | | | The qdoc manual currently claims that the command must stand on its own line. The change follows the consistency with the rest and how the example looks like inside the qdoc manual for this command. Change-Id: I6b653dc95cf9d84e4adf32220dace5d313678419 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Make sure codecForLocale returns a valid codec in bootstrap modeJan-Arve Saether2012-08-061-1/+1
| | | | | | | | | This was a regression caused by acbfb4d777474aadd2813614108, causing for instance qdoc to crash. Change-Id: Id8daa19d467c4f1729e5a5a203a388f16ec4a6de Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* ICU: lock the mutex before calling an Unlocked functionThiago Macieira2012-08-041-0/+2
| | | | | | | | | | | | | The QIcuCodec::defaultCodecUnlocked function is not thread-safe because it calls codecForNameUnlocked. In turn, that one accesses and even modifies a QHash stored in the QCoreGlobalData singleton, which is what makes it non-threadsafe. In order to call the Unlocked function, we need to lock the mutex first. Change-Id: I915570110229f4c0929986aa26731244317ef6ab Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* ICU: Mark which functions are threadsafe and which ones aren'tThiago Macieira2012-08-043-14/+20
| | | | | | | | | | | | | Mark the thread-safe functions with the \threadsafe doc marker. This includes public API, which should be thread-safe anyway. The thread-unsafe functions are marked "\nonreentrant" already. In addition, I renamed the functions that must be called with locked mutexes to Unlocked, following the convention in other libraries like libdbus-1. Change-Id: Ibd93d1266149767f546c8e82959b73c138008469 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Align the CP949 codec name with ICULars Knoll2012-07-312-6/+9
| | | | | | | | It's name is windows-949 according to ICU. Keep CP949 as an alias for compatibility with Qt 4. Change-Id: I115ba2593da6f7b47e25136c3fadb19c7f798ff0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Small doc fixes about the list of supported codecs.Lars Knoll2012-07-311-3/+3
| | | | | Change-Id: I98b8ec9d5de9e69f1bb6187b4d820d61f7ce03e5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Do not preload any codecs anymore when using ICULars Knoll2012-07-314-30/+81
| | | | | | | | | When using ICU we can now avoid pre loading any codecs at startup. Instead QTextCodecs will always be created lazily when first asked for. Change-Id: Ic668f2824700896d2eca7d0de54f978404826163 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a factory method to QIsciiCodec and fix the namesLars Knoll2012-07-312-9/+21
| | | | | | | | | Make the names all lower case to be in line with what ICU reports. Add a factory method to create the codecs according to their name. Change-Id: Ia3dddaa7701a0645d9d8fbcb52f1f8d58f79cf98 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use ICU instead of iconv/windows codecs for the localeLars Knoll2012-07-314-35/+50
| | | | | | | | With ICU there's no need to use the windows locale or iconv codecs anymore as locale codecs. Change-Id: I50c94a97ed6acbf4c6f05b2a88593a57ebfa8342 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make codecForLocale atomicLars Knoll2012-07-311-36/+35
| | | | | Change-Id: I8017b1c2aa1df8d613e83919a945fd5f320713d6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* ICU code page conversion supportLars Knoll2012-07-314-24/+790
| | | | | | | | | | | | | Use ICU to do code page conversion instead of the builtin text codecs. With this QTextCodec simply becomes a wrapper around ICU's ucnv_* methods. We only keep our own codecs for UTF-*, ISO-8859-1, ISO-8859-15 for performance reasons, and for TSCII and iscii-* because they aren't supported by ICU. Change-Id: I4fc49eba55cf772b9772c6dac606a47a44346a60 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename some codecs to be in line with ICULars Knoll2012-07-311-2/+2
| | | | | Change-Id: If523d2a12ef64c79e3860da1f430f128d24ff600 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Disable iconv on utf-8 based platformsLars Knoll2012-07-312-4/+5
| | | | | | | | | There's no need to use iconv on Mac, iOS, Android or QNX, as all these platforms are fully utf-8 based. Change-Id: I2a03c8dea72ad91f6ec83da0a838de20e46babef Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Lazily initialize iconv in the iconv codecLars Knoll2012-07-312-4/+12
| | | | | | | | | | | | | | | Avoid dlopen'ing libiconv and initializing it's members until the codec gets used for the first time. This avoids some memory and startup time overhead in case we can use the utf8 codec instead of iconv. It also removes a circular dependency between codec initialization during app startup. Change-Id: I119c010c288dc59ab32279d8a213ae1f4347cace Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use utf-8 as the locale codec where it makes senseLars Knoll2012-07-311-6/+8
| | | | | | | | | Use utf8 as the fallback codec in case we can't determine something else instead of latin1. Also use utf8 for Mac, iOS, Android and QNX. Change-Id: I15dc85d2406b1ebdfacff25f45f8b6854c52b97e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove encoding detection according to LANGLars Knoll2012-07-311-142/+0
| | | | | | | | | This code is left over from the 90's, and should not get used anymore. In all relevant cases we will use UTF-8 or iconv nowadays. Change-Id: Ie3776f671de33f782fa77f6359bf6e105bd9c1b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move the text codec list to qcoreglobaldata.Lars Knoll2012-07-312-195/+90
| | | | | | | | | | | This removes some global statics in QTextCodec and makes the code better to maintain in the longer term. Remove QT_NO_THREAD defines around mutexes as this isn't required in Qt 5 anymore. Change-Id: I15ede75f53b16f134f4053f3188c4b47e86fcd8a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move the windows locale codec into it's own fileLars Knoll2012-07-234-217/+330
| | | | | | | | | Simple cleanup, that will make it easier to refactor the code to use ICU. Change-Id: I7486f36d27b8c521cf970327eb94b2236338d4ec Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
* Remove the font codecsLars Knoll2012-06-2512-902/+2
| | | | | | | | 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>
* The codecForTr() should be utf8Lars Knoll2012-06-251-1/+1
| | | | | | | | tr() assumes utf8 as input encoding, not latin1. Change-Id: If834f8c169bdb431d78713d14b03542d3a7ca8e4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* define QT_NO_ICONV if QT_NO_TEXTCODECJeremy Katz2012-06-201-0/+4
| | | | | | | | | | | | This also updates qfeatures.h with various other things that have been neglected. Run $QTSRCDIR/util/scripts/make_qfeatures_dot_h after changing qfeatures.txt Task-number: QTBUG-24816 Change-Id: I18b71fcec71efa9cfe3425fb1a7833456ec411b9 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* disable codecs for asian language when QT_NO_BIG_CODECS definedTasuku Suzuki2012-06-1423-56/+65
| | | | | Change-Id: I45025b13bacc5f63946b02a87c742beff1946c0b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* QtCore: remove \link usagesGiuseppe D'Angelo2012-05-292-8/+7
| | | | | Change-Id: I0de764b51a972de0b6eb2bf3c04d2b190f581f52 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Avoid using iconv for text conversion where possibleLars Knoll2012-05-162-38/+29
| | | | | | | | | | | | Try to use a builtin codec as codecForLocale() if possible first. Fall back and instantiate the iconv codec only if that failed. In addition, make sure we initialize the locale correctly before we try to setup the codec. Change-Id: I86d635f9d11e8ff93093f162e79fb37f3d85731b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QChar: add isSurrogate() and isNonCharacter() to the public APIKonstantin Ritt2012-05-161-4/+3
| | | | | | | | + QChar::LastValidCodePoint enum value that supercede the UNICODE_LAST_CODEPOINT macro replace uses of hardcoded values with the new API; remove leftovers Change-Id: I1395c9840b85fcb6b08e241b131794a98773c952 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* add some useful methods to QUnicodeTables::Konstantin Ritt2012-05-101-15/+3
| | | | | | | in order to reduce code duplication and prepare the ground for upcoming changes Change-Id: I980244149f65384c9484bbec4682de8b7b848b08 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add Android to conditionals around langinfo.h usage.Robin Burchell2012-05-041-3/+5
| | | | | | | | Despite being mandated by POSIX, Android does not support this. Change-Id: I3da42ff9b3336cb6657692a9eb70dd3118ac1756 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Prepare for building modular QtCore docs.Casper van Donderen2012-04-192-10/+10
| | | | | | | | | | | | This change fixes most qdoc errors in QtCore. There are about 900 left. The main thing this change does is moving documentation from qtcore from /doc/src to /src/corelib/doc. Other issues resolved are mis-use of qdoc commands. Change-Id: I002d01edfb13575e8bf27ce91596a577a92562d1 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>