| 452 | class RIconvWrapper { |
| 453 | public: |
| 454 | RIconvWrapper(std::string to, std::string from) |
| 455 | : handle_(Riconv_open(to.c_str(), from.c_str())) { |
| 456 | if (handle_ == ((void*)-1)) { |
| 457 | cpp11::stop("Can't convert encoding from '%s' to '%s'", from.c_str(), to.c_str()); |
| 458 | } |
| 459 | } |
| 460 | |
| 461 | size_t iconv(const uint8_t** inbuf, int64_t* inbytesleft, uint8_t** outbuf, |
| 462 | int64_t* outbytesleft) { |