{"action":"created","issue":{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/655","repository_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK","labels_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/655/labels{/name}","comments_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/655/comments","events_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/655/events","html_url":"https://github.com/paypal/PayPal-PHP-SDK/pull/655","id":178583787,"number":655,"title":"bugfix: UTF8 encoding in result response from sandbox, corrupts json response","user":{"login":"bhoehl","id":5765571,"avatar_url":"https://avatars.githubusercontent.com/u/5765571?v=3","gravatar_id":"","url":"https://api.github.com/users/bhoehl","html_url":"https://github.com/bhoehl","followers_url":"https://api.github.com/users/bhoehl/followers","following_url":"https://api.github.com/users/bhoehl/following{/other_user}","gists_url":"https://api.github.com/users/bhoehl/gists{/gist_id}","starred_url":"https://api.github.com/users/bhoehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhoehl/subscriptions","organizations_url":"https://api.github.com/users/bhoehl/orgs","repos_url":"https://api.github.com/users/bhoehl/repos","events_url":"https://api.github.com/users/bhoehl/events{/privacy}","received_events_url":"https://api.github.com/users/bhoehl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/labels/sdk-enhancement","name":"sdk-enhancement","color":"c7def8"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-09-22T11:24:15Z","updated_at":"2016-09-29T09:10:36Z","closed_at":"2016-09-26T16:27:43Z","pull_request":{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/pulls/655","html_url":"https://github.com/paypal/PayPal-PHP-SDK/pull/655","diff_url":"https://github.com/paypal/PayPal-PHP-SDK/pull/655.diff","patch_url":"https://github.com/paypal/PayPal-PHP-SDK/pull/655.patch"},"body":"@jaypatel512 \r\n- PHP 5.6:\r\n- PayPal-PHP-SDK 1.7.4:\r\n- Debug ID(s):\r\n\r\nfile /lib/PayPal/Core\\PayPalHttpConnection.php line 150 reads\r\n        // Get Request and Response Headers\r\n        $requestHeaders = curl_getinfo($ch, CURLINFO_HEADER_OUT);\r\n        //Using alternative solution to CURLINFO_HEADER_SIZE as it throws invalid number when called using PROXY.\r\n        $responseHeaderSize = strlen($result) - curl_getinfo($ch, CURLINFO_SIZE_DOWNLOAD);\r\n        $responseHeaders = substr($result, 0, $responseHeaderSize);\r\n        $result = substr($result, $responseHeaderSize);\r\n\r\nThe response getting from curl_exec is a string, which is binary. In my case strlen is treating this binary string as UTF8 and is returning a different strlen than the string is when written to disk, using characters like 'äöü ... '. strlen seems to be replaced with mb_strlen, which then uses the default encoding ( UTF8 ).\r\n\r\nA better approach is to use mb_strlen in combination with 8bit encoding.\r\nAny idea, if utf_decode has to be used, too ?\r\n\r\nsee: php.ini using mbstring.func_overload"},"comment":{"url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/comments/250412383","html_url":"https://github.com/paypal/PayPal-PHP-SDK/pull/655#issuecomment-250412383","issue_url":"https://api.github.com/repos/paypal/PayPal-PHP-SDK/issues/655","id":250412383,"user":{"login":"bhoehl","id":5765571,"avatar_url":"https://avatars.githubusercontent.com/u/5765571?v=3","gravatar_id":"","url":"https://api.github.com/users/bhoehl","html_url":"https://github.com/bhoehl","followers_url":"https://api.github.com/users/bhoehl/followers","following_url":"https://api.github.com/users/bhoehl/following{/other_user}","gists_url":"https://api.github.com/users/bhoehl/gists{/gist_id}","starred_url":"https://api.github.com/users/bhoehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhoehl/subscriptions","organizations_url":"https://api.github.com/users/bhoehl/orgs","repos_url":"https://api.github.com/users/bhoehl/repos","events_url":"https://api.github.com/users/bhoehl/events{/privacy}","received_events_url":"https://api.github.com/users/bhoehl/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T09:10:36Z","updated_at":"2016-09-29T09:10:36Z","body":"@jaypatel512 \r\nwhen will there be a release containing this fix ?\r\nthis hinders us using composer, as we can not change our php.ini settings\r\nand patching this file is no option for us\r\n\r\nThanks\r\n\r\nBernd"}}
{"actor":{"display_login":"bhoehl"}}