{"action":"created","issue":{"url":"https://api.github.com/repos/martinsvalin/html_entities/issues/5","labels_url":"https://api.github.com/repos/martinsvalin/html_entities/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/martinsvalin/html_entities/issues/5/comments","events_url":"https://api.github.com/repos/martinsvalin/html_entities/issues/5/events","html_url":"https://github.com/martinsvalin/html_entities/issues/5","id":92921862,"number":5,"title":"Add `encode`","user":{"login":"martinsvalin","id":203989,"avatar_url":"https://avatars.githubusercontent.com/u/203989?v=3","gravatar_id":"","url":"https://api.github.com/users/martinsvalin","html_url":"https://github.com/martinsvalin","followers_url":"https://api.github.com/users/martinsvalin/followers","following_url":"https://api.github.com/users/martinsvalin/following{/other_user}","gists_url":"https://api.github.com/users/martinsvalin/gists{/gist_id}","starred_url":"https://api.github.com/users/martinsvalin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinsvalin/subscriptions","organizations_url":"https://api.github.com/users/martinsvalin/orgs","repos_url":"https://api.github.com/users/martinsvalin/repos","events_url":"https://api.github.com/users/martinsvalin/events{/privacy}","received_events_url":"https://api.github.com/users/martinsvalin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-03T18:50:21Z","updated_at":"2016-01-28T15:26:17Z","closed_at":null,"body":"I'd like to add `encode` to the public api, like so:\r\n\r\n```elixir\r\niex> HtmlEntities.encode(\"åäö\")\r\n\"&aring;&auml;&ouml;\"\r\n```\r\n\r\nThere could be options to specify if we should use named, decimal or hex entities. The might be options to only encode unsafe characters, like < and >, and options to avoid \"double-encoding\" if there are already entities in the string, so \"&amp;\" won't become \"&amp;amp;\"."},"comment":{"url":"https://api.github.com/repos/martinsvalin/html_entities/issues/comments/176235456","html_url":"https://github.com/martinsvalin/html_entities/issues/5#issuecomment-176235456","issue_url":"https://api.github.com/repos/martinsvalin/html_entities/issues/5","id":176235456,"user":{"login":"jwarlander","id":59837,"avatar_url":"https://avatars.githubusercontent.com/u/59837?v=3","gravatar_id":"","url":"https://api.github.com/users/jwarlander","html_url":"https://github.com/jwarlander","followers_url":"https://api.github.com/users/jwarlander/followers","following_url":"https://api.github.com/users/jwarlander/following{/other_user}","gists_url":"https://api.github.com/users/jwarlander/gists{/gist_id}","starred_url":"https://api.github.com/users/jwarlander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwarlander/subscriptions","organizations_url":"https://api.github.com/users/jwarlander/orgs","repos_url":"https://api.github.com/users/jwarlander/repos","events_url":"https://api.github.com/users/jwarlander/events{/privacy}","received_events_url":"https://api.github.com/users/jwarlander/received_events","type":"User","site_admin":false},"created_at":"2016-01-28T15:26:17Z","updated_at":"2016-01-28T15:26:17Z","body":"Encoding the unsafe characters mentioned above seems like it would be a reasonably good starting point.. If you agree, please do have a look at my pull request (#11), and let me know if there's anything you'd like to see implemented differently! "}}