]> git.lyx.org Git - lyx.git/blobdiff - src/support/unicode.cpp
Set correctly the spacing between atoms in MathData
[lyx.git] / src / support / unicode.cpp
index adec55299c552221a6fbb7c8aef2657e9c1df9b3..2620ddb5e44e895854d239cd1748b779088a7478 100644 (file)
@@ -62,7 +62,7 @@ struct IconvProcessor::Handler {
 
 
 IconvProcessor::IconvProcessor(string tocode, string fromcode)
-       : tocode_(tocode), fromcode_(fromcode)
+       : tocode_(move(tocode)), fromcode_(move(fromcode))
 {}
 
 
@@ -132,23 +132,11 @@ int IconvProcessor::convert(char const * buf, size_t buflen,
                        lyxerr << "E2BIG  There is not sufficient room at *outbuf." << endl;
                        break;
                case EILSEQ:
-                       lyxerr << "EILSEQ An invalid multibyte sequence"
-                               << " has been encountered in the input.\n"
-                               << "When converting from " << fromcode_
-                               << " to " << tocode_ << ".\n";
-                       lyxerr << "Input:" << hex;
-                       for (size_t i = 0; i < buflen; ++i) {
-                               // char may be signed, avoid output of
-                               // something like 0xffffffc2
-                               boost::uint32_t const b =
-                                       *reinterpret_cast<unsigned char const *>(buf + i);
-                               lyxerr << " 0x" << (unsigned int)b;
-                       }
-                       lyxerr << dec << endl;
-                       break;
                case EINVAL:
-                       lyxerr << "EINVAL An incomplete multibyte sequence"
-                               << " has been encountered in the input.\n"
+                       lyxerr << (errno == EINVAL
+                                  ? "EINVAL An incomplete "
+                                  : "EILSEQ An invalid ")
+                               << "multibyte sequence has been encountered in the input.\n"
                                << "When converting from " << fromcode_
                                << " to " << tocode_ << ".\n";
                        lyxerr << "Input:" << hex;