X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Funicode.cpp;h=2620ddb5e44e895854d239cd1748b779088a7478;hb=bf56e2c8e1afa857cd5e313c19948040e41b8227;hp=187d018f2bc03da066e011483d6c3b0e21cff8cf;hpb=e87febd0de53172186eeb3307729dcbb2d6f8c5c;p=lyx.git diff --git a/src/support/unicode.cpp b/src/support/unicode.cpp index 187d018f2b..2620ddb5e4 100644 --- a/src/support/unicode.cpp +++ b/src/support/unicode.cpp @@ -62,7 +62,14 @@ struct IconvProcessor::Handler { IconvProcessor::IconvProcessor(string tocode, string fromcode) - : tocode_(tocode), fromcode_(fromcode) + : tocode_(move(tocode)), fromcode_(move(fromcode)) +{} + + +// for gcc 4.6 +IconvProcessor::IconvProcessor(IconvProcessor && other) + : tocode_(move(other.tocode_)), fromcode_(move(other.fromcode_)), + h_(move(other.h_)) {} @@ -125,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(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;