{"action":"created","comment":{"url":"https://api.github.com/repos/zumba/json-serializer/pulls/comments/66255119","id":66255119,"diff_hunk":"@@ -60,6 +66,30 @@ Or add the `zumba/json-serializer` directly in your `composer.json` file.\n \n If you are not using composer, you can just copy the files from `src` folder in your project.\n \n+## Serializing Binary Strings\n+\n+Binary strings introduce two special identifiers in the final json: `@utf8encoded` and `@scalar`.\n+`@utf8encoded` is an array of keys from the original data which have their value (or the keys themselves) \n+encoded from 8bit to UTF-8. This is how the serializer knows what to ecode back from UTF-8 to 8bit when deserializing. \n+Example:\n+\n+```php\n+$data = ['key' => '<binaryvalue>', 'anotherkey' => 'nonbinaryvalue'];\n+$serializer = new Zumba\\JsonSerializer\\JsonSerializer();\n+$json = $serializer->serialize($data);\n+// $json will contain the content {\"key\":\"<utf8encodedbinaryvalue>\",\"anotherkey\":\"nonbinaryvalue\",\"@utf8encoded\":{\"key\":1}}\n+```\n+\n+`@scalar` is used only when the value to be encoded is not an array or an object but a binary string. Example:\n+\n+```php\n+$data = '<binaryvalue>;","path":"README.md","position":49,"original_position":49,"commit_id":"23688757e88cb69454251a58e5ccd7dc73e43aaa","original_commit_id":"23688757e88cb69454251a58e5ccd7dc73e43aaa","user":{"login":"jrbasso","id":26548,"avatar_url":"https://avatars.githubusercontent.com/u/26548?v=3","gravatar_id":"","url":"https://api.github.com/users/jrbasso","html_url":"https://github.com/jrbasso","followers_url":"https://api.github.com/users/jrbasso/followers","following_url":"https://api.github.com/users/jrbasso/following{/other_user}","gists_url":"https://api.github.com/users/jrbasso/gists{/gist_id}","starred_url":"https://api.github.com/users/jrbasso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrbasso/subscriptions","organizations_url":"https://api.github.com/users/jrbasso/orgs","repos_url":"https://api.github.com/users/jrbasso/repos","events_url":"https://api.github.com/users/jrbasso/events{/privacy}","received_events_url":"https://api.github.com/users/jrbasso/received_events","type":"User","site_admin":false},"body":"@ghola Missing close single quotes.","created_at":"2016-06-08T13:30:26Z","updated_at":"2016-06-08T13:30:26Z","html_url":"https://github.com/zumba/json-serializer/pull/24#discussion_r66255119","pull_request_url":"https://api.github.com/repos/zumba/json-serializer/pulls/24","_links":{"self":{"href":"https://api.github.com/repos/zumba/json-serializer/pulls/comments/66255119"},"html":{"href":"https://github.com/zumba/json-serializer/pull/24#discussion_r66255119"},"pull_request":{"href":"https://api.github.com/repos/zumba/json-serializer/pulls/24"}}},"pull_request":{"url":"https://api.github.com/repos/zumba/json-serializer/pulls/24","id":72858352,"html_url":"https://github.com/zumba/json-serializer/pull/24","diff_url":"https://github.com/zumba/json-serializer/pull/24.diff","patch_url":"https://github.com/zumba/json-serializer/pull/24.patch","issue_url":"https://api.github.com/repos/zumba/json-serializer/issues/24","number":24,"state":"open","locked":false,"title":"Added support for binary string","user":{"login":"ghola","id":932205,"avatar_url":"https://avatars.githubusercontent.com/u/932205?v=3","gravatar_id":"","url":"https://api.github.com/users/ghola","html_url":"https://github.com/ghola","followers_url":"https://api.github.com/users/ghola/followers","following_url":"https://api.github.com/users/ghola/following{/other_user}","gists_url":"https://api.github.com/users/ghola/gists{/gist_id}","starred_url":"https://api.github.com/users/ghola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghola/subscriptions","organizations_url":"https://api.github.com/users/ghola/orgs","repos_url":"https://api.github.com/users/ghola/repos","events_url":"https://api.github.com/users/ghola/events{/privacy}","received_events_url":"https://api.github.com/users/ghola/received_events","type":"User","site_admin":false},"body":"Implements issue #23 ","created_at":"2016-06-07T11:28:31Z","updated_at":"2016-06-08T13:30:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8bc09eff013bf23edfaec54c2c61c8aadd7cf9bf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zumba/json-serializer/pulls/24/commits","review_comments_url":"https://api.github.com/repos/zumba/json-serializer/pulls/24/comments","review_comment_url":"https://api.github.com/repos/zumba/json-serializer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zumba/json-serializer/issues/24/comments","statuses_url":"https://api.github.com/repos/zumba/json-serializer/statuses/23688757e88cb69454251a58e5ccd7dc73e43aaa","head":{"label":"ghola:binary-data","ref":"binary-data","sha":"23688757e88cb69454251a58e5ccd7dc73e43aaa","user":{"login":"ghola","id":932205,"avatar_url":"https://avatars.githubusercontent.com/u/932205?v=3","gravatar_id":"","url":"https://api.github.com/users/ghola","html_url":"https://github.com/ghola","followers_url":"https://api.github.com/users/ghola/followers","following_url":"https://api.github.com/users/ghola/following{/other_user}","gists_url":"https://api.github.com/users/ghola/gists{/gist_id}","starred_url":"https://api.github.com/users/ghola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghola/subscriptions","organizations_url":"https://api.github.com/users/ghola/orgs","repos_url":"https://api.github.com/users/ghola/repos","events_url":"https://api.github.com/users/ghola/events{/privacy}","received_events_url":"https://api.github.com/users/ghola/received_events","type":"User","site_admin":false},"repo":{"id":60293941,"name":"json-serializer","full_name":"ghola/json-serializer","owner":{"login":"ghola","id":932205,"avatar_url":"https://avatars.githubusercontent.com/u/932205?v=3","gravatar_id":"","url":"https://api.github.com/users/ghola","html_url":"https://github.com/ghola","followers_url":"https://api.github.com/users/ghola/followers","following_url":"https://api.github.com/users/ghola/following{/other_user}","gists_url":"https://api.github.com/users/ghola/gists{/gist_id}","starred_url":"https://api.github.com/users/ghola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghola/subscriptions","organizations_url":"https://api.github.com/users/ghola/orgs","repos_url":"https://api.github.com/users/ghola/repos","events_url":"https://api.github.com/users/ghola/events{/privacy}","received_events_url":"https://api.github.com/users/ghola/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ghola/json-serializer","description":"Serialize PHP variables, including objects, in JSON format. Support to unserialize it too.","fork":true,"url":"https://api.github.com/repos/ghola/json-serializer","forks_url":"https://api.github.com/repos/ghola/json-serializer/forks","keys_url":"https://api.github.com/repos/ghola/json-serializer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ghola/json-serializer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ghola/json-serializer/teams","hooks_url":"https://api.github.com/repos/ghola/json-serializer/hooks","issue_events_url":"https://api.github.com/repos/ghola/json-serializer/issues/events{/number}","events_url":"https://api.github.com/repos/ghola/json-serializer/events","assignees_url":"https://api.github.com/repos/ghola/json-serializer/assignees{/user}","branches_url":"https://api.github.com/repos/ghola/json-serializer/branches{/branch}","tags_url":"https://api.github.com/repos/ghola/json-serializer/tags","blobs_url":"https://api.github.com/repos/ghola/json-serializer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ghola/json-serializer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ghola/json-serializer/git/refs{/sha}","trees_url":"https://api.github.com/repos/ghola/json-serializer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ghola/json-serializer/statuses/{sha}","languages_url":"https://api.github.com/repos/ghola/json-serializer/languages","stargazers_url":"https://api.github.com/repos/ghola/json-serializer/stargazers","contributors_url":"https://api.github.com/repos/ghola/json-serializer/contributors","subscribers_url":"https://api.github.com/repos/ghola/json-serializer/subscribers","subscription_url":"https://api.github.com/repos/ghola/json-serializer/subscription","commits_url":"https://api.github.com/repos/ghola/json-serializer/commits{/sha}","git_commits_url":"https://api.github.com/repos/ghola/json-serializer/git/commits{/sha}","comments_url":"https://api.github.com/repos/ghola/json-serializer/comments{/number}","issue_comment_url":"https://api.github.com/repos/ghola/json-serializer/issues/comments{/number}","contents_url":"https://api.github.com/repos/ghola/json-serializer/contents/{+path}","compare_url":"https://api.github.com/repos/ghola/json-serializer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ghola/json-serializer/merges","archive_url":"https://api.github.com/repos/ghola/json-serializer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ghola/json-serializer/downloads","issues_url":"https://api.github.com/repos/ghola/json-serializer/issues{/number}","pulls_url":"https://api.github.com/repos/ghola/json-serializer/pulls{/number}","milestones_url":"https://api.github.com/repos/ghola/json-serializer/milestones{/number}","notifications_url":"https://api.github.com/repos/ghola/json-serializer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ghola/json-serializer/labels{/name}","releases_url":"https://api.github.com/repos/ghola/json-serializer/releases{/id}","deployments_url":"https://api.github.com/repos/ghola/json-serializer/deployments","created_at":"2016-06-02T20:08:56Z","updated_at":"2016-06-02T20:08:57Z","pushed_at":"2016-06-07T12:47:08Z","git_url":"git://github.com/ghola/json-serializer.git","ssh_url":"git@github.com:ghola/json-serializer.git","clone_url":"https://github.com/ghola/json-serializer.git","svn_url":"https://github.com/ghola/json-serializer","homepage":"http://tech.zumba.com/2014/01/06/json-serializer/","size":66,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"zumba:master","ref":"master","sha":"68c6a72f243a4799ee519ac000142ddf41d32531","user":{"login":"zumba","id":67415,"avatar_url":"https://avatars.githubusercontent.com/u/67415?v=3","gravatar_id":"","url":"https://api.github.com/users/zumba","html_url":"https://github.com/zumba","followers_url":"https://api.github.com/users/zumba/followers","following_url":"https://api.github.com/users/zumba/following{/other_user}","gists_url":"https://api.github.com/users/zumba/gists{/gist_id}","starred_url":"https://api.github.com/users/zumba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zumba/subscriptions","organizations_url":"https://api.github.com/users/zumba/orgs","repos_url":"https://api.github.com/users/zumba/repos","events_url":"https://api.github.com/users/zumba/events{/privacy}","received_events_url":"https://api.github.com/users/zumba/received_events","type":"Organization","site_admin":false},"repo":{"id":15656289,"name":"json-serializer","full_name":"zumba/json-serializer","owner":{"login":"zumba","id":67415,"avatar_url":"https://avatars.githubusercontent.com/u/67415?v=3","gravatar_id":"","url":"https://api.github.com/users/zumba","html_url":"https://github.com/zumba","followers_url":"https://api.github.com/users/zumba/followers","following_url":"https://api.github.com/users/zumba/following{/other_user}","gists_url":"https://api.github.com/users/zumba/gists{/gist_id}","starred_url":"https://api.github.com/users/zumba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zumba/subscriptions","organizations_url":"https://api.github.com/users/zumba/orgs","repos_url":"https://api.github.com/users/zumba/repos","events_url":"https://api.github.com/users/zumba/events{/privacy}","received_events_url":"https://api.github.com/users/zumba/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zumba/json-serializer","description":"Serialize PHP variables, including objects, in JSON format. Support to unserialize it too.","fork":false,"url":"https://api.github.com/repos/zumba/json-serializer","forks_url":"https://api.github.com/repos/zumba/json-serializer/forks","keys_url":"https://api.github.com/repos/zumba/json-serializer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zumba/json-serializer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zumba/json-serializer/teams","hooks_url":"https://api.github.com/repos/zumba/json-serializer/hooks","issue_events_url":"https://api.github.com/repos/zumba/json-serializer/issues/events{/number}","events_url":"https://api.github.com/repos/zumba/json-serializer/events","assignees_url":"https://api.github.com/repos/zumba/json-serializer/assignees{/user}","branches_url":"https://api.github.com/repos/zumba/json-serializer/branches{/branch}","tags_url":"https://api.github.com/repos/zumba/json-serializer/tags","blobs_url":"https://api.github.com/repos/zumba/json-serializer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zumba/json-serializer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zumba/json-serializer/git/refs{/sha}","trees_url":"https://api.github.com/repos/zumba/json-serializer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zumba/json-serializer/statuses/{sha}","languages_url":"https://api.github.com/repos/zumba/json-serializer/languages","stargazers_url":"https://api.github.com/repos/zumba/json-serializer/stargazers","contributors_url":"https://api.github.com/repos/zumba/json-serializer/contributors","subscribers_url":"https://api.github.com/repos/zumba/json-serializer/subscribers","subscription_url":"https://api.github.com/repos/zumba/json-serializer/subscription","commits_url":"https://api.github.com/repos/zumba/json-serializer/commits{/sha}","git_commits_url":"https://api.github.com/repos/zumba/json-serializer/git/commits{/sha}","comments_url":"https://api.github.com/repos/zumba/json-serializer/comments{/number}","issue_comment_url":"https://api.github.com/repos/zumba/json-serializer/issues/comments{/number}","contents_url":"https://api.github.com/repos/zumba/json-serializer/contents/{+path}","compare_url":"https://api.github.com/repos/zumba/json-serializer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zumba/json-serializer/merges","archive_url":"https://api.github.com/repos/zumba/json-serializer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zumba/json-serializer/downloads","issues_url":"https://api.github.com/repos/zumba/json-serializer/issues{/number}","pulls_url":"https://api.github.com/repos/zumba/json-serializer/pulls{/number}","milestones_url":"https://api.github.com/repos/zumba/json-serializer/milestones{/number}","notifications_url":"https://api.github.com/repos/zumba/json-serializer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zumba/json-serializer/labels{/name}","releases_url":"https://api.github.com/repos/zumba/json-serializer/releases{/id}","deployments_url":"https://api.github.com/repos/zumba/json-serializer/deployments","created_at":"2014-01-05T18:27:03Z","updated_at":"2016-05-22T20:38:27Z","pushed_at":"2016-06-07T12:47:08Z","git_url":"git://github.com/zumba/json-serializer.git","ssh_url":"git@github.com:zumba/json-serializer.git","clone_url":"https://github.com/zumba/json-serializer.git","svn_url":"https://github.com/zumba/json-serializer","homepage":"http://tech.zumba.com/2014/01/06/json-serializer/","size":95,"stargazers_count":57,"watchers_count":57,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":3,"forks":12,"open_issues":3,"watchers":57,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zumba/json-serializer/pulls/24"},"html":{"href":"https://github.com/zumba/json-serializer/pull/24"},"issue":{"href":"https://api.github.com/repos/zumba/json-serializer/issues/24"},"comments":{"href":"https://api.github.com/repos/zumba/json-serializer/issues/24/comments"},"review_comments":{"href":"https://api.github.com/repos/zumba/json-serializer/pulls/24/comments"},"review_comment":{"href":"https://api.github.com/repos/zumba/json-serializer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zumba/json-serializer/pulls/24/commits"},"statuses":{"href":"https://api.github.com/repos/zumba/json-serializer/statuses/23688757e88cb69454251a58e5ccd7dc73e43aaa"}}}}
{"actor":{"display_login":"jrbasso"}}