It turned out to be easy indeed. The attached patch enables the Qt
Help->About dialog to display accented characters nicely.

Ok to apply?

Jean-Marc, interested in something similar for 1.3.x.?

-- 
Angus
Index: src/frontends/qt2/ChangeLog
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/ChangeLog,v
retrieving revision 1.759
diff -u -p -r1.759 ChangeLog
--- src/frontends/qt2/ChangeLog	21 Mar 2005 08:31:54 -0000	1.759
+++ src/frontends/qt2/ChangeLog	8 Apr 2005 09:29:30 -0000
@@ -1,3 +1,8 @@
+2005-04-08  Angus Leeming  <[EMAIL PROTECTED]>
+
+	* QAbout.C (build_dialog): specify that the CREDITS data is
+	encoded in ISO-8859-1 (latin1).
+
 2005-03-18  Georg Baum  <[EMAIL PROTECTED]>
 
 	* ui/QPrefLatexModule.ui: fix layout
Index: src/frontends/qt2/QAbout.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/qt2/QAbout.C,v
retrieving revision 1.35
diff -u -p -r1.35 QAbout.C
--- src/frontends/qt2/QAbout.C	24 Jul 2004 10:55:22 -0000	1.35
+++ src/frontends/qt2/QAbout.C	8 Apr 2005 09:29:30 -0000
@@ -24,6 +24,7 @@
 
 #include <qlabel.h>
 #include <qpushbutton.h>
+#include <qtextcodec.h>
 #include <qtextview.h>
 
 using lyx::support::prefixIs;
@@ -104,7 +105,16 @@ void QAbout::build_dialog()
 	}
 #endif
 
-	dialog_->creditsTV->setText(toqstr(out.str()));
+	// Try and grab the latin1 codec
+	QTextCodec * const codec =
+		QTextCodec::codecForName("ISO8859-1");
+	if (!codec)
+		lyxerr << "Unable to find ISO8859-1 codec" << std::endl;
+
+	QString const qtext = codec ?
+		codec->toUnicode(out.str().c_str()) :
+		toqstr(out.str());
+	dialog_->creditsTV->setText(qtext);
 
 	// try to resize to a good size
 	dialog_->copyright->hide();

Reply via email to