Jürgen Spitzmüller wrote:
> If we allowed all unicode symbols, be it in utf8 inputenc or XeTeX (which
> we do not support yet properly), this would ask for trouble, since neither
> in inputenc nor with XeTeX you can just insert any unicode char without
> further ado.

having written this, there is indeed something wrong: if you use another than 
the default encoding for the document, we have to check for that. The 
attached patch fixes this.

However, if you use utf8, you'll see two drawbacks:

1. the dialog becomes slow. This is mainly because of the expensive category 
handling.

2. lots of symbols are missing in the dialog. This is a general problem: if Qt 
cannot find a glyph in the font database, it inserts a white rectangle. I 
think we should insert something more remarkable (a red question mark or 
something), but I do not know how to check if a glyph is available.

If we had access to something like python's unicodedata in C++, we could also 
add nice tooltips displaying the name of the glyph.

Ideas welcome.

Jürgen
Index: src/frontends/qt4/GuiSymbols.cpp
===================================================================
--- src/frontends/qt4/GuiSymbols.cpp	(Revision 22850)
+++ src/frontends/qt4/GuiSymbols.cpp	(Arbeitskopie)
@@ -17,6 +17,7 @@
 #include "qt_helpers.h"
 
 #include "Buffer.h"
+#include "BufferParams.h"
 #include "BufferView.h"
 #include "Encoding.h"
 
@@ -165,7 +166,10 @@
 {
 	chosenLE->clear();
 
-	string const & new_encoding = bufferview()->cursor().getEncoding()->name();
+	string new_encoding = bufferview()->cursor().getEncoding()->name();
+	if (buffer().params().inputenc != "auto" &&
+	    buffer().params().inputenc != "default")
+		new_encoding = buffer().params().encoding().name();
 	if (new_encoding == encoding_)
 		// everything up to date
 		return;

Reply via email to