Am 03.07.2012 21:01, schrieb Uwe Stöhr:

Ah, I tried to output as char and that failed. I'll try now with string and 
propose a patch.

Attached is the patch for bug
http://www.lyx.org/trac/ticket/8230

I tested it with all sorts of verbatim that I could imagine and also with 
single '\' as \verb argument.

OK?

thanks and regards
Uwe
diff --git "a/C:\\DOCUME~1\\usti\\LOCALS~1\\Temp\\tex14.tmp\\text-HEAD-left.cpp" "b/D:\\LyXGit\\Master\\src\\tex2lyx\\text.cpp"
index cebc6fb..091ebd3 100644
--- "a/C:\\DOCUME~1\\usti\\LOCALS~1\\Temp\\tex14.tmp\\text-HEAD-left.cpp"
+++ "b/D:\\LyXGit\\Master\\src\\tex2lyx\\text.cpp"
@@ -3645,12 +3645,18 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
 			}
 		}
 
-		else if (t.cs() == "verb") {
+		else if (prefixIs(t.cs(), "verb")) {
+			// as soon as a command begins with \verb, it is verbatim
+			// for example \verbätimä
 			context.check_layout(os);
-			char const delimiter = p.next_token().character();
+			char delimiter;
+			docstring s = from_utf8(p.next_token().asInput());
+			// cut off the first character (in case there are more)
+			s = s[0];
+			delimiter = to_utf8(s)[0];
 			string const arg = p.getArg(delimiter, delimiter);
 			ostringstream oss;
-			oss << "\\verb" << delimiter << arg << delimiter;
+			oss << "\\verb" << to_utf8(s) << arg << to_utf8(s);
 			handle_ert(os, oss.str(), context);
 		}
 

Reply via email to