Any resources to learn about how to work with character encodings with Rcpp?

encoding
rcpp

#1

I've faced an encoding problem with readr, which is triggered by the release of R 3.5.0, and tried to fix it on Rcpp's side.

But, I couldn't find the neat way to convert the Rcpp::String to std::string with the specified encoding. Base R has Rf_translateChar(). Does Rcpp have the corresponding function for this?

More general question I want to ask is, are there any good resources about how to work with character encodings with Rcpp/C++/C? I always ran into these readings:

Any suggestions are welcome!


#2

No, there is no corresponding Rcpp function, you just use the C API in this case on the underlying CHARSXP.


#3

Thanks, I'll try to get used to the C API.