Skip to content
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

Merged
merged 1 commit into from
Aug 3, 2016

Conversation

thirdwing
Copy link
Member

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

@@ -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) {
Copy link
Contributor

@kevinushey kevinushey Aug 2, 2016

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)

Copy link
Member Author

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) {
Copy link
Contributor

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.

@thirdwing thirdwing changed the title Rcpp::String ctor update Rcpp::String ctor update(close #263) Aug 2, 2016
@kevinushey
Copy link
Contributor

PR looks good for me; let's see if anyone else has thoughts.

@eddelbuettel
Copy link
Member

Same here. Lemme sleep it over and give a glance over morning coffee in 6 to 7 hours and it'll go in.

@eddelbuettel eddelbuettel merged commit 0bf8e97 into RcppCore:master Aug 3, 2016
eddelbuettel added a commit that referenced this pull request Aug 3, 2016
From branch 'string_ctor2' of https://github.com/thirdwing/Rcpp into feature/pr529
eddelbuettel added a commit that referenced this pull request Aug 3, 2016
@eddelbuettel
Copy link
Member

Merged by hand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants