#include <iconv.h>
-#include <boost/cstdint.hpp>
-
#include <cerrno>
+#include <cstdint>
#include <map>
#include <ostream>
//Needed in MSVC
struct IconvProcessor::Handler {
// assumes cd is valid
- Handler(iconv_t const cd) : cd(cd) {}
+ explicit Handler(iconv_t const cd) : cd(cd) {}
~Handler() {
if (iconv_close(cd) == -1)
LYXERR0("Error returned from iconv_close(" << errno << ')');
{}
-// for gcc 4.6
-IconvProcessor::IconvProcessor(IconvProcessor && other)
- : tocode_(move(other.tocode_)), fromcode_(move(other.fromcode_)),
- h_(move(other.h_))
-{}
-
-
bool IconvProcessor::init()
{
if (h_)
// flush out remaining data. This is needed because iconv sometimes
// holds back chars in the stream, waiting for a combination character
// (see e.g. http://sources.redhat.com/bugzilla/show_bug.cgi?id=1124)
- iconv(h_->cd, NULL, NULL, &outbuf, &outbytesleft);
+ iconv(h_->cd, nullptr, nullptr, &outbuf, &outbytesleft);
//lyxerr << dec;
//lyxerr << "Inbytesleft: " << inbytesleft << endl;
for (size_t i = 0; i < buflen; ++i) {
// char may be signed, avoid output of
// something like 0xffffffc2
- boost::uint32_t const b =
+ uint32_t const b =
*reinterpret_cast<unsigned char const *>(buf + i);
lyxerr << " 0x" << (unsigned int)b;
}
return vector<RetType>(tmp, tmp + bytes / sizeof(RetType));
}
-} // anon namespace
+} // namespace
IconvProcessor & utf8ToUcs4()
return it->second;
}
-} //anon namespace
+} // namespace
vector<char>
return *processors.localData();
}
-}
+} // namespace
vector<char>
ucs4_to_eightbit(char_type const * ucs4str, size_t ls, string const & encoding)