{"action":"created","issue":{"url":"https://api.github.com/repos/erlcloud/erlcloud/issues/296","repository_url":"https://api.github.com/repos/erlcloud/erlcloud","labels_url":"https://api.github.com/repos/erlcloud/erlcloud/issues/296/labels{/name}","comments_url":"https://api.github.com/repos/erlcloud/erlcloud/issues/296/comments","events_url":"https://api.github.com/repos/erlcloud/erlcloud/issues/296/events","html_url":"https://github.com/erlcloud/erlcloud/issues/296","id":167164806,"number":296,"title":"Incorrect character encoding with erlcloud_http:url_encode/1","user":{"login":"ishikawa","id":18448,"avatar_url":"https://avatars.githubusercontent.com/u/18448?v=3","gravatar_id":"","url":"https://api.github.com/users/ishikawa","html_url":"https://github.com/ishikawa","followers_url":"https://api.github.com/users/ishikawa/followers","following_url":"https://api.github.com/users/ishikawa/following{/other_user}","gists_url":"https://api.github.com/users/ishikawa/gists{/gist_id}","starred_url":"https://api.github.com/users/ishikawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ishikawa/subscriptions","organizations_url":"https://api.github.com/users/ishikawa/orgs","repos_url":"https://api.github.com/users/ishikawa/repos","events_url":"https://api.github.com/users/ishikawa/events{/privacy}","received_events_url":"https://api.github.com/users/ishikawa/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-07-23T03:30:10Z","updated_at":"2016-07-25T10:41:09Z","closed_at":"2016-07-25T10:41:09Z","body":"Erlcloud uses `erlcloud_http:url_encode/1` to encode data to [Percent-encoding](https://en.wikipedia.org/wiki/Percent-encoding), but its result is incorrect for some Unicode characters.\r\n\r\n### Examples\r\n\r\nI usually play with Elixir and Ruby, so the example is `iex` and `irb`. The Unicode codepoint `U+8000` (\"耀\") should be encoded as `%E8%80%80`, but `erlcloud_http:url_encode/1` output is `%F0%88%80%80`.\r\n\r\n**Erlcloud**\r\n\r\n```elixir\r\n% iex -S mix run -e 'IO.puts :erlcloud_http.url_encode(\"\\u{8000}\")'\r\nErlang/OTP 19 [erts-8.0.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]\r\n...\r\n%F0%88%80%80\r\n```\r\n\r\n**Ruby**\r\n\r\n```ruby\r\n% ruby -r uri -e 'puts URI.encode(\"\\u{8000}\")'\r\n%E8%80%80\r\n```\r\n\r\n### Environment\r\n\r\n- Erlang/OTP 19 `Erlang/OTP 19 [erts-8.0.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]`\r\n- Elixir 1.3.1\r\n- Erlcloud [0.13.6](https://github.com/erlcloud/erlcloud/releases/tag/0.13.6)\r\n- Ruby 2.0.0p648"},"comment":{"url":"https://api.github.com/repos/erlcloud/erlcloud/issues/comments/234920214","html_url":"https://github.com/erlcloud/erlcloud/issues/296#issuecomment-234920214","issue_url":"https://api.github.com/repos/erlcloud/erlcloud/issues/296","id":234920214,"user":{"login":"smilerlee","id":2290642,"avatar_url":"https://avatars.githubusercontent.com/u/2290642?v=3","gravatar_id":"","url":"https://api.github.com/users/smilerlee","html_url":"https://github.com/smilerlee","followers_url":"https://api.github.com/users/smilerlee/followers","following_url":"https://api.github.com/users/smilerlee/following{/other_user}","gists_url":"https://api.github.com/users/smilerlee/gists{/gist_id}","starred_url":"https://api.github.com/users/smilerlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smilerlee/subscriptions","organizations_url":"https://api.github.com/users/smilerlee/orgs","repos_url":"https://api.github.com/users/smilerlee/repos","events_url":"https://api.github.com/users/smilerlee/events{/privacy}","received_events_url":"https://api.github.com/users/smilerlee/received_events","type":"User","site_admin":false},"created_at":"2016-07-25T10:41:09Z","updated_at":"2016-07-25T10:41:09Z","body":"fixed, thanks for your reporting"}}
{"actor":{"display_login":"smilerlee"}}