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

NSASCIIStringEncoding in parameters function in NSMutableURLRequest+Parameters.m causing crash when contains unicode data? #22

Open
AKPHYO opened this issue May 13, 2012 · 0 comments

Comments

@AKPHYO
Copy link

AKPHYO commented May 13, 2012

Put any Unicode string in OAMutableURLRequest httpbody data,the library will crash in this function call.
NSArray *parameters = [self parameters] in the following code.

  • (NSString *)_signatureBaseString {
    // OAuth Spec, Section 9.1.1 "Normalize Request Parameters"
    // build a sorted array of both request parameters and OAuth header parameters
    NSDictionary *tokenParameters = [token parameters];
    // 6 being the number of OAuth params in the Signature Base String
    NSArray *parameters = [self parameters];

I checked and found NSASCIIStringEncoding is being used in two places in the following functions in this file NSMutableURLRequest+Parameters.m

  • (NSArray *)parameters {
    ...
  • (void)setHTTPBodyWithString:(NSString *)body {
    ...

. I think they should be NSUTF8StringEncoding. I changed and tested. no crash anymore.

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

No branches or pull requests

1 participant