-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix oauth_encode() #424
fix oauth_encode() #424
Conversation
@yutannihilation Thanks alot 🥇 you saved me |
@Crackz Oh, I'm glad to hear that 😄 Actually, I've noticed this bug when I was trying rtweet... |
But, I'm a bit afraid httr may be no more maintained since I see no responses to the issues and PRs since half a years ago. Hmm... |
Ah, I got it. Hadley says this five months ago:
|
I hope it come soon ... |
Agreed. |
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.
Can you please also add a bullet to NEWS?
tests/testthat/test-oauth.R
Outdated
restored_string <- URLdecode(oauth_encode1(orig_string)) | ||
Encoding(restored_string) <- "UTF-8" | ||
|
||
expect_equal( |
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.
Can you please put this on one line?
a38c24b
to
ff173af
Compare
Thanks! Updated NEWS and test. |
Thanks! |
Thanks for merging! This bug was a bit annoying, so I'm very happy to see this closed! 🍺 |
* fix oauth_encode() * update test * update NEWS
This PR fixes #423.
The problem is in this part of
oauth_encode1()
:This seems to expect the result of
charToRaw(x)
is a single character, but this assumption fails whenx
is a UTF-8 character:Therefore, the following line doesn't work well:
As the length of the left hand side is smaller than the right hand side, some bytes at the tail is lost when assigning. That's what this warning says.
This pull request adds
collapse = ""
so thatencode()
returns a single character vector.