Update: From @tospig reply, I'm expecting there to be a .set_encoding()
method on cpp11::writables::strings
, which is a missing feature at the moment. Therefore, now I ask for an equivalent method to set the encoding.
I'm trying to understand a bit of Rcpp vs cpp11 and I found a non-documented case when trying to set the encoding, which is compatible within the std library.
This works with Rcpp:
using namespace Rcpp;
...
Rcpp::Strings x_utf8 = x;
x_utf8.set_encoding(CE_UTF8);
This doesn't work with cpp11:
using namespace cpp11;
...
cpp11::writables::strings x_utf8 = x;
x_utf8.set_encoding(CE_UTF8);
The corresponding error is error: ‘cpp11::writable::strings’ {aka ‘class cpp11::writable::r_vector<cpp11::r_string>’} has no member named ‘set_encoding’