-
Notifications
You must be signed in to change notification settings - Fork 2
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
url_decode2
is not NA aware
#47
Comments
@chainsawriot Do you mean something like CharacterVector Rcpp_ada_get(const CharacterVector& url_vec, std::function<ada_string(ada_url)> func, bool decode) {
unsigned int n = url_vec.length();
CharacterVector out(n);
for (int i = 0; i < url_vec.length(); i++) {
String s = url_vec[i];
const char* input = s.get_cstring();
ada_url url = ada_parse(input, std::strlen(input));
if (!ada_is_valid(url)) {
out[i] = NA_STRING;
} else {
out[i] = charsub(func(url));
}
}
if(decode){
return(url_decode2(out))
}else{
return (out);
}
} |
yeah. I am eyeing on removing all of these https://github.com/schochastics/adaR/blob/14692c751ac2fdbc97caa5b491357788d51eb7f6/R/parse.R#L20-L42 |
url_decode2(NULL) kills R. |
@schochastics Would you mind me changing CharacterVector url_decode2(CharacterVector& url) {
if (url.isNULL()) {
CharacterVector output(0);
return output;
}
}
|
@chainsawriot no go ahead and make that change |
Still not working
Created on 2023-09-27 with reprex v2.0.2
Fixing this can also enable decoding in C++.
The text was updated successfully, but these errors were encountered: