{"action":"created","issue":{"url":"https://api.github.com/repos/tweetdeck-archive/TDOAuth/issues/23","repository_url":"https://api.github.com/repos/tweetdeck-archive/TDOAuth","labels_url":"https://api.github.com/repos/tweetdeck-archive/TDOAuth/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/tweetdeck-archive/TDOAuth/issues/23/comments","events_url":"https://api.github.com/repos/tweetdeck-archive/TDOAuth/issues/23/events","html_url":"https://github.com/tweetdeck-archive/TDOAuth/issues/23","id":229292867,"number":23,"title":"Serious encoding problem","user":{"login":"joehsieh","id":2487113,"avatar_url":"https://avatars3.githubusercontent.com/u/2487113?v=3","gravatar_id":"","url":"https://api.github.com/users/joehsieh","html_url":"https://github.com/joehsieh","followers_url":"https://api.github.com/users/joehsieh/followers","following_url":"https://api.github.com/users/joehsieh/following{/other_user}","gists_url":"https://api.github.com/users/joehsieh/gists{/gist_id}","starred_url":"https://api.github.com/users/joehsieh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joehsieh/subscriptions","organizations_url":"https://api.github.com/users/joehsieh/orgs","repos_url":"https://api.github.com/users/joehsieh/repos","events_url":"https://api.github.com/users/joehsieh/events{/privacy}","received_events_url":"https://api.github.com/users/joehsieh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-05-17T09:36:35Z","updated_at":"2017-05-18T03:24:17Z","closed_at":null,"body":"Hi @mxcl ,\r\nI have an encoding problem. I know TDPCEN is used to encode parameters that we want to put it to the URL, but I think the allowedCharacters is not correct.\r\n\r\nhttps://github.com/tweetdeck-archive/TDOAuth/blob/ae2c28edff37ee844cc5732870a10c75215c9384/TDOAuth.m#L37\r\n\r\n#define TDPCEN(s) \\\r\n      ([[s description] stringByAddingPercentEncodingWithAllowedCharacters:[[NSCharacterSet characterSetWithCharactersInString:@\"^!*'();:@&=+$,/?%#[] \"] invertedSet]])\r\n\r\nFor example, \r\nInput:\r\n{\r\n    q = \"insert into db ( jsonData ) values ( '{\\\"a\\\":\\\"b\\\",\\\"c\\\":\\\"d\\\"}' )\";\r\n}\r\nTDPCEN(\"q\")\r\nTDPCEN(\"insert into db ( jsonData ) values ( '{\\\"a\\\":\\\"b\\\",\\\"c\\\":\\\"d\\\"}' )\")\r\n\r\nOutput:\r\nq=insert%20into%20db%20%28%20jsonData%20%29%20values%20%28%20%27{\"a\"%3A\"b\"%2C\"c\"%3A\"d\"}%27%20%29\r\n\r\nWe notice that {, } and \" are not encoded, and it cause NSURL to be nil.\r\nIt may occur in https://github.com/tweetdeck-archive/TDOAuth/blob/ae2c28edff37ee844cc5732870a10c75215c9384/TDOAuth.m#L280\r\n\r\nI have an idea to solve the problem.\r\nJust replace [[NSCharacterSet characterSetWithCharactersInString:@\"^!*'();:@&=+$,/?%#[] \"] invertedSet]] with [NSCharacterSet URLQueryAllowedCharacterSet] to correct it.\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/tweetdeck-archive/TDOAuth/issues/comments/302290127","html_url":"https://github.com/tweetdeck-archive/TDOAuth/issues/23#issuecomment-302290127","issue_url":"https://api.github.com/repos/tweetdeck-archive/TDOAuth/issues/23","id":302290127,"user":{"login":"mxcl","id":58962,"avatar_url":"https://avatars1.githubusercontent.com/u/58962?v=3","gravatar_id":"","url":"https://api.github.com/users/mxcl","html_url":"https://github.com/mxcl","followers_url":"https://api.github.com/users/mxcl/followers","following_url":"https://api.github.com/users/mxcl/following{/other_user}","gists_url":"https://api.github.com/users/mxcl/gists{/gist_id}","starred_url":"https://api.github.com/users/mxcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mxcl/subscriptions","organizations_url":"https://api.github.com/users/mxcl/orgs","repos_url":"https://api.github.com/users/mxcl/repos","events_url":"https://api.github.com/users/mxcl/events{/privacy}","received_events_url":"https://api.github.com/users/mxcl/received_events","type":"User","site_admin":false},"created_at":"2017-05-18T03:24:17Z","updated_at":"2017-05-18T03:24:17Z","body":"PR welcome."}}
{"actor":{"display_login":"mxcl"}}