Add support for "Apple Roman" encoding

Substitute this encoding by "macintosh" when Qt is built with ICU.
It is for compatibility with Qt 4.x.

Change-Id: I70c51cba7d473ac81e25862736cb71a2f6894055
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
bb10
Alexander Volkov 2014-10-20 16:31:34 +04:00
parent 6841dd6ecc
commit 7645b64d89
2 changed files with 3 additions and 0 deletions

View File

@ -445,6 +445,8 @@ QTextCodec *QIcuCodec::codecForNameUnlocked(const char *name)
// backwards compatibility with Qt 4.x
if (!qstrcmp(name, "CP949"))
name = "windows-949";
else if (!qstrcmp(name, "Apple Roman"))
name = "macintosh";
// these are broken data in ICU 4.4, and can't be resolved even though they are aliases to tis-620
if (!qstrcmp(name, "windows-874-2000")
|| !qstrcmp(name, "windows-874")

View File

@ -196,6 +196,7 @@ void tst_QTextCodec::fromUnicode_data()
QTest::newRow("windows-1257") << "windows-1257" << true;
QTest::newRow("windows-1258") << "windows-1258" << true;
QTest::newRow("Apple Roman") << "Apple Roman" << true;
QTest::newRow("macintosh") << "macintosh" << true;
//QTest::newRow("WINSAMI2") << "WINSAMI2" << true;
QTest::newRow("TIS-620") << "TIS-620" << true;