-
-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rcpp::String ctor update(close #263) #529
Conversation
@@ -53,7 +52,7 @@ namespace Rcpp { | |||
typedef internal::const_string_proxy<STRSXP> const_StringProxy; | |||
|
|||
/** default constructor */ | |||
String(): data(Rf_mkChar("")), buffer(), valid(true), buffer_ready(true), enc(CE_NATIVE) { | |||
String(): data(Rf_mkChar("")), buffer(), valid(true), buffer_ready(true), enc(CE_UTF8) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the data element be initialized with Rf_mkCharCE()
? Do we need to explicitly set the encoding? (probably doesn't matter for the empty string but we should be consistent)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree.
@@ -88,7 +87,7 @@ namespace Rcpp { | |||
RCPP_STRING_DEBUG("String(SEXP)"); | |||
} | |||
|
|||
String(SEXP charsxp, const std::string& enc) : data(R_NilValue) { | |||
String(SEXP charsxp, cetype_t enc) : data(R_NilValue) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above -- overriding encoding on a passed-in charsxp.
PR looks good for me; let's see if anyone else has thoughts. |
Same here. Lemme sleep it over and give a glance over morning coffee in 6 to 7 hours and it'll go in. |
Merged by hand |
As discussed in #263
(1) remove the string representation of encoding (I am not sure if any pkgs really use this, we might need a rev.dep);
(2) use
CE_UTF8
as default encoding (not sure if this will cause problems with no-English string).@kevinushey @hadley @jjallaire