code-google-com / arora

Automatically exported from code.google.com/p/arora
0 stars 0 forks source link

"Text Encoding" doesn't operate correctly. #891

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you have a webpage rendering issue (aka bug in QtWebKit) it should be
filed on bugs.webkit.org.  If you are unsure you can file it here and we
will let you know.

What steps will reproduce the problem?
1.Choose arbitrary encode.
2.Open "Text Encoding" menu again.
3.The encode has not been correctly selected.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
 Arora 0.10.2
 Windows XP SP3
 Ubuntu Linux 9.10

Please provide any additional information below.

 The cause is a difference of the codecs-list that "QTextCodec::availableCodecs()" and "QTextCodec::availableMibs()" output.
 This is a patch sample.
----------
--- ./arora/src/browsermainwindow.cpp   Fri Apr 23 02:11:09 2010
+++ ./arora/src/browsermainwindow.cpp   Fri Apr 23 02:11:10 2010
@@ -925,12 +925,18 @@
     Q_UNUSED(action);
 #if QT_VERSION >= 0x040600 || defined(WEBKIT_TRUNK)
     Q_ASSERT(action);
-    QList<QByteArray> codecs = QTextCodec::availableCodecs();
+    QStringList codecs;
+    QList<int> mibs = QTextCodec::availableMibs();
+    foreach (const int &mib, mibs) {
+        QString codec = QLatin1String(QTextCodec::codecForMib(mib)->name());
+        codecs.append(codec);
+    }
+    codecs.sort();
     int offset = action->data().toInt();
     if (offset < 0 || offset >= codecs.count())
         QWebSettings::globalSettings()->setDefaultTextEncoding(QString());
     else
-        
QWebSettings::globalSettings()->setDefaultTextEncoding(QLatin1String(codecs[offs
et]));
+        QWebSettings::globalSettings()->setDefaultTextEncoding(codecs[offset]);
 #endif
 }

-----------

Original issue reported on code.google.com by shoes_...@hotmail.com on 24 Jun 2010 at 6:49

GoogleCodeExporter commented 9 years ago

Original comment by ice...@gmail.com on 15 Jul 2010 at 12:20

GoogleCodeExporter commented 9 years ago
Thanks for the report, fixed in git

28d4ad2a87cee04a495836c87b06c9b17358293f

Original comment by ice...@gmail.com on 15 Jul 2010 at 4:34