From 98114f5a8290f15c9ddcf9bb94954b6dbace37b9 Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Tue, 23 Dec 2008 02:03:53 +0000 Subject: [PATCH] Take into account that '\' is always part of a LaTeX command and also that entries in the unicodesymbols file may not start with '\'. Maybe the method should be renamed as fromLaTeXCode? git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27957 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Encoding.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Encoding.cpp b/src/Encoding.cpp index 8041de988f..69437bf2f5 100644 --- a/src/Encoding.cpp +++ b/src/Encoding.cpp @@ -496,8 +496,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) - && ((tmp.size() == 1 && !isAlphaASCII(tmp[0])) - || k == cmdend || !isAlphaASCII(cmd[k]))) { + && (tmp[0] != '\\' + || (tmp.size() == 2 && !isAlphaASCII(tmp[1])) + || k == cmdend || !isAlphaASCII(cmd[k]))) { c = it->first; j = k - 1; i = j + 1;