]> git.lyx.org Git - features.git/commitdiff
Fix the translation of macros like: \"u, which don't appear
authorRichard Heck <rgheck@comcast.net>
Sun, 11 Jan 2009 21:40:10 +0000 (21:40 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 11 Jan 2009 21:40:10 +0000 (21:40 +0000)
in unicodesymbols.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28105 a592a061-630c-0410-9148-cb99ea01b6c8

src/insets/InsetBibtex.cpp

index a3affb4d9363d2dea8a65164157618294cf6a0c7..6270b1345a035dce3e49ebd4d10845ee106d9623 100644 (file)
@@ -38,6 +38,8 @@
 #include "support/Path.h"
 #include "support/textutils.h"
 
+#include <boost/regex.hpp>
+
 #include <limits>
 
 using namespace std;
@@ -725,6 +727,14 @@ namespace {
 
                        // ok, could be a command of some sort
                        // let's see if it corresponds to some unicode
+                       // unicodesymbols has things in the form: \"{u},
+                       // whereas we may see things like: \"u. So we'll
+                       // look for that and change it, if necessary.
+                       static boost::regex const reg("^\\\\\\W\\w");
+                       if (boost::regex_search(to_utf8(val), reg)) {
+                               val.insert(3, from_ascii("}"));
+                               val.insert(2, from_ascii("{"));
+                       }
                        docstring rem;
                        docstring const cnvtd = Encodings::fromLaTeXCommand(val, rem);
                        if (!cnvtd.empty()) {