]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetSpecialChar.cpp
requires is a keyword in C++2a
[lyx.git] / src / insets / InsetSpecialChar.cpp
index 76da971ea0bbea1e03250ea1727e658f6e96fc31..740061e0312ea85a2ef60aa639f478ccbfdefd5d 100644 (file)
@@ -15,6 +15,7 @@
 #include "InsetSpecialChar.h"
 
 #include "Dimension.h"
+#include "Encoding.h"
 #include "Font.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
@@ -384,6 +385,7 @@ void InsetSpecialChar::latex(otexstream & os,
                             OutputParams const & rp) const
 {
        bool const rtl = rp.local_font->isRightToLeft();
+       bool const utf8 = rp.encoding->iconvName() == "UTF-8";
        string lswitch = "";
        string lswitche = "";
        if (rtl && !rp.use_polyglossia) {
@@ -399,10 +401,15 @@ void InsetSpecialChar::latex(otexstream & os,
                os << "\\-";
                break;
        case ALLOWBREAK:
+               // U+200B not yet supported by utf8 inputenc
                os << "\\LyXZeroWidthSpace" << termcmd;
                break;
        case LIGATURE_BREAK:
-               os << "\\textcompwordmark" << termcmd;
+               if (utf8)
+                       // U+200C ZERO WIDTH NON-JOINER
+                       os.put(0x200c);
+               else
+                       os << "\\textcompwordmark" << termcmd;
                break;
        case END_OF_SENTENCE:
                os << "\\@.";