]> git.lyx.org Git - lyx.git/blobdiff - src/Encoding.cpp
Handle paragraph direction switch in captions (with polyglossia/bidi)
[lyx.git] / src / Encoding.cpp
index b3efc20f5789477d9eb02eb679c1ca1b8907eb88..2379209d270cc25d80b63059377f12cc3cb9c5da 100644 (file)
 #include "support/textutils.h"
 #include "support/unicode.h"
 
-#include <boost/cstdint.hpp>
-
-#include <iterator>
 #include <algorithm>
+#include <cstdint>
+#include <iterator>
 #include <sstream>
 
 using namespace std;
@@ -193,13 +192,11 @@ bool Encoding::encodable(char_type c) const
                return true;
        // platex does not load inputenc: force conversion of supported characters
        if (package_ == Encoding::japanese
-           && ((0x7f < c && c <= 0x05ff) // Latin-1 Supplement ... Hebrew
-                       || (0x1d00 < c && c <= 0x218f) // Phonetic Extensions ... Number Forms
-                       || (0x2193 < c && c <= 0x2aff) // Arrows ... Supplemental Mathematical Operators
-                       || (0xfb00 < c && c <= 0xfb4f) // Alphabetic Presentation Forms
-                       || (0x1d400 < c && c <= 0x1d7ff)) // Mathematical Alphanumeric Symbols
-               && c != 0xa2 && c != 0xa3 && c != 0xa5 && c != 0xa7 // exceptions
-               && c != 0xa8 && c != 0xb0 && c != 0xb4 && c != 0xb6)  
+           && ((0xb7 <= c && c <= 0x05ff) // Latin-1 Supplement ... Hebrew
+                       || (0x1d00 <= c && c <= 0x218f) // Phonetic Extensions ... Number Forms
+                       || (0x2193 <= c && c <= 0x2aff) // Arrows ... Supplemental Mathematical Operators
+                       || (0xfb00 <= c && c <= 0xfb4f) // Alphabetic Presentation Forms
+                       || (0x1d400 <= c && c <= 0x1d7ff))) // Mathematical Alphanumeric Symbols
                return false;
        if (c < start_encodable_ && !isForced(c))
                return true;
@@ -232,8 +229,8 @@ pair<docstring, docstring> Encoding::latexString(docstring const & input, bool d
        docstring uncodable;
        bool terminate = false;
        for (size_t n = 0; n < input.size(); ++n) {
+               char_type const c = input[n];
                try {
-                       char_type const c = input[n];
                        pair<docstring, bool> latex_char = latexChar(c);
                        docstring const latex = latex_char.first;
                        if (terminate && !prefixIs(latex, '\\')
@@ -250,7 +247,8 @@ pair<docstring, docstring> Encoding::latexString(docstring const & input, bool d
                        result += latex;
                        terminate = latex_char.second;
                } catch (EncodingException & /* e */) {
-                       LYXERR0("Uncodable character in latexString!");
+                       LYXERR0("Uncodable character <" << docstring(1, c) 
+                                       << "> in latexString!");
                        if (dryrun) {
                                result += "<" + _("LyX Warning: ")
                                           + _("uncodable character") + " '";
@@ -704,7 +702,7 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
                istringstream is(symbolslex.getString());
                // reading symbol directly does not work if
                // char_type == wchar_t.
-               boost::uint32_t tmp;
+               uint32_t tmp;
                if(!(is >> hex >> tmp))
                        break;
                symbol = tmp;