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?
Rcpp::String
std::string
Rf_translateChar()
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!
No, there is no corresponding Rcpp function, you just use the C API in this case on the underlying CHARSXP.
CHARSXP
Thanks, I'll try to get used to the C API.