Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upuse 'Rf_mkCharLenCE() as appropriate #917
Conversation
| @@ -395,9 +395,12 @@ namespace Rcpp { | |||
| enc = encoding; | |||
|
|
|||
| if (valid) { | |||
| data = Rcpp_ReplaceObject(data, Rf_mkCharCE(Rf_translateCharUTF8(data), encoding)); | |||
| const void* vmax = vmaxget(); | |||
kevinushey
Oct 25, 2018
Author
Contributor
I noticed that translateCharUTF8() has, in the R sources:
so it's recommended that we manage the stack after usage. Not sure if we should do this in this PR or just leave it out for now though.
I noticed that translateCharUTF8() has, in the R sources:
so it's recommended that we manage the stack after usage. Not sure if we should do this in this PR or just leave it out for now though.
|
It just occurred to me that we don't want the R error (ie the |
|
That sounds like a worthwhile change. |
|
@kevinushey Do you want to add an error check before |
|
Yes, sorry -- I'll try to get to it soon. |
|
No worries -- that was the right call. No rush. |
|
I'm confused. Did you amend the initial commit in this PR? I am only seeing one commit when there should have been two. |
|
Yes, I amended the original commit -- I tend to do this on feature branches just to keep the commit history clean. (Although perhaps it's better to just squash and merge rather than retroactively change history on the branch) |
|
Yes, we could settle on just squashing. I also don't single / non-parallel branches merging back. In any event here the downside was that your repo co-user, ie me, got lost :). |
|
Sorry for the confusion :-) Ultimately, this should be ready to go now. |
|
It looks like the |
|
Interesting. Have we ever done that? Explicitly accomodate other packages? (And yes, hdf5 package seem to be a in constant state of flux. Too bad CRAN doesn't just patch...) Edit: I also know the h5 maintainer so I can always ask... |
Not that I can recall, but given that it's one package with a simple workaround, I don't mind having this live in Rcpp if it means existing code depending on |
|
It is on the hack-ish side of things but if we mean it to be temporary I can live with it. Let me email Mario and see what he says. |
|
Oh, and I just now see the rather nice ticket you opened there already. Well done. |
Closes #916, taking option (1) -- signal an error if an embedded NUL byte is encountered, as R does.