From df8bb4edcdce7c37cc9c20645058628ab2738784 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Mon, 22 Dec 2008 15:23:05 +0000 Subject: [PATCH] * Encoding.cpp (fromLaTeXCommand): fix bug when the string passed to the method does not match any of the known unicode symbols. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27953 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Encoding.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Encoding.cpp b/src/Encoding.cpp index 4680003030..8041de988f 100644 --- a/src/Encoding.cpp +++ b/src/Encoding.cpp @@ -23,6 +23,7 @@ #include "support/debug.h" #include "support/FileName.h" #include "support/lstrings.h" +#include "support/textutils.h" #include "support/unicode.h" #include @@ -494,7 +495,9 @@ docstring Encodings::fromLaTeXCommand(docstring const & cmd, docstring & rem) // If this is an exact match, we found a (longer) // matching command in the unicodesymbols file - if (math == tmp || text == tmp) { + if ((math == tmp || text == tmp) + && ((tmp.size() == 1 && !isAlphaASCII(tmp[0])) + || k == cmdend || !isAlphaASCII(cmd[k]))) { c = it->first; j = k - 1; i = j + 1;