> Yes. I am trying to display the character ... There is something
> tricky about the handling of a character in docstring.

OK. With the attached simple patch, the offending characters are
replaced by <Uncodable character: '?'>. The whole paragraph is
displayed (as Enrico wishes), but it is easy to see where the
offending characters are. The text seems to be long and I will accept
any suggestion such as <?>, <Error: ?> where ? is the offending
character.

With all my tests, I can not see any uncodable char in the view source
and error dialog. This is not a problem with my patch because they are
displayed as blanks in the view source dialog before. There are
obviously two solutions:

1. Because the main window can display these characters, there might
be some qt trick to make view source and error dialog display them as
well.

2. Do not try to display them at all. For example, display ??? in the
places of offending characters.

Maybe Abdel knows why they are displayed as blanks?

Bo

Index: src/Paragraph.cpp
===================================================================
--- src/Paragraph.cpp   (revision 22261)
+++ src/Paragraph.cpp   (working copy)
@@ -2236,10 +2236,14 @@
                                        basefont, outerfont, open_font,
                                        runningChange, *style, i, column, c);
                } catch (EncodingException & e) {
-                       // add location information and throw again.
-                       e.par_id = id();
-                       e.pos = i;
-                       throw(e);
+                       if (runparams.dryrun)
+                               os << "<Uncodable character: '" << c << "'>";
+                       else {
+                               // add location information and throw again.
+                               e.par_id = id();
+                               e.pos = i;
+                               throw(e);
+                       }
                }
Index: src/Paragraph.cpp
===================================================================
--- src/Paragraph.cpp	(revision 22261)
+++ src/Paragraph.cpp	(working copy)
@@ -2236,10 +2236,14 @@
 					basefont, outerfont, open_font,
 					runningChange, *style, i, column, c);
 		} catch (EncodingException & e) {
-			// add location information and throw again.
-			e.par_id = id();
-			e.pos = i;
-			throw(e);
+			if (runparams.dryrun)
+				os << "<Uncodable character: '" << c << "'>";
+			else {
+				// add location information and throw again.
+				e.par_id = id();
+				e.pos = i;
+				throw(e);
+			}
 		}
 
 		// Set the encoding to that returned from simpleTeXSpecialChars (see

Reply via email to