{"action":"created","issue":{"url":"https://api.github.com/repos/libgd/libgd/issues/185","repository_url":"https://api.github.com/repos/libgd/libgd","labels_url":"https://api.github.com/repos/libgd/libgd/issues/185/labels{/name}","comments_url":"https://api.github.com/repos/libgd/libgd/issues/185/comments","events_url":"https://api.github.com/repos/libgd/libgd/issues/185/events","html_url":"https://github.com/libgd/libgd/issues/185","id":105597137,"number":185,"title":"Add support for 4 byte UTF-8 characters and HTML entities over &#xFFFF; and &#99999;","user":{"login":"stil","id":714004,"avatar_url":"https://avatars.githubusercontent.com/u/714004?v=3","gravatar_id":"","url":"https://api.github.com/users/stil","html_url":"https://github.com/stil","followers_url":"https://api.github.com/users/stil/followers","following_url":"https://api.github.com/users/stil/following{/other_user}","gists_url":"https://api.github.com/users/stil/gists{/gist_id}","starred_url":"https://api.github.com/users/stil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stil/subscriptions","organizations_url":"https://api.github.com/users/stil/orgs","repos_url":"https://api.github.com/users/stil/repos","events_url":"https://api.github.com/users/stil/events{/privacy}","received_events_url":"https://api.github.com/users/stil/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/libgd/libgd/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"cmb69","id":2306138,"avatar_url":"https://avatars.githubusercontent.com/u/2306138?v=3","gravatar_id":"","url":"https://api.github.com/users/cmb69","html_url":"https://github.com/cmb69","followers_url":"https://api.github.com/users/cmb69/followers","following_url":"https://api.github.com/users/cmb69/following{/other_user}","gists_url":"https://api.github.com/users/cmb69/gists{/gist_id}","starred_url":"https://api.github.com/users/cmb69/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmb69/subscriptions","organizations_url":"https://api.github.com/users/cmb69/orgs","repos_url":"https://api.github.com/users/cmb69/repos","events_url":"https://api.github.com/users/cmb69/events{/privacy}","received_events_url":"https://api.github.com/users/cmb69/received_events","type":"User","site_admin":false},"assignees":[{"login":"cmb69","id":2306138,"avatar_url":"https://avatars.githubusercontent.com/u/2306138?v=3","gravatar_id":"","url":"https://api.github.com/users/cmb69","html_url":"https://github.com/cmb69","followers_url":"https://api.github.com/users/cmb69/followers","following_url":"https://api.github.com/users/cmb69/following{/other_user}","gists_url":"https://api.github.com/users/cmb69/gists{/gist_id}","starred_url":"https://api.github.com/users/cmb69/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmb69/subscriptions","organizations_url":"https://api.github.com/users/cmb69/orgs","repos_url":"https://api.github.com/users/cmb69/repos","events_url":"https://api.github.com/users/cmb69/events{/privacy}","received_events_url":"https://api.github.com/users/cmb69/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2015-09-09T13:32:32Z","updated_at":"2016-08-23T18:49:43Z","closed_at":null,"body":"Currently, GD supports only UTF-8 characters of 1-3 bytes. Four byte characters are unsupported. HTML entities higher than  `&#xFFFF;` and `&#99999;` are also unsupported.\r\n\r\nIt makes impossible to draw emojis, which are Unicode characters higher than U+1F601. UTF-8 representation of emojis are at least 4 bytes long. I thought I could bypass this issue using HTML entities. However it seems, that they are bugged too.\r\n\r\nInvalid code lies in `gdft.c` file, `gdTcl_UtfToUniChar()` function.\r\n\r\nSources:\r\n* [Only 1-3 byte UTF-8 characters in `gdft.c`](https://github.com/libgd/libgd/blob/master/src/gdft.c#L340-L342)\r\n* [Code responsible for HTML entities parsing in `gdft.c`](https://github.com/libgd/libgd/blob/master/src/gdft.c#L293-L314)\r\n* [More information on the bug in PHP bugtracker](https://bugs.php.net/bug.php?id=51135)\r\n* [Proposed patch from PHP bugtracker](https://bugs.php.net/patch-display.php?bug=51135&patch=bundled-libgd-non-bmp-entities&revision=1267806282&display=1)\r\n\r\nPossibly related issue\r\n---\r\nSomeone at PHP bugtracker suspects, that due to integer overflow, Unicode characters higher than 65536 might also be broken.\r\n> The responses to this report seem to imply that ImageTtfText WIIL work correctly for characters in the range U+10000 - U+1869F (65536 - 99999). However, this does not seem to be the case. When I call it with `&#65537;` (U+10001), it produces an \"missing\" glyph, even using a font that contains the character (CODE2001.ttf).\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/libgd/libgd/issues/comments/241836950","html_url":"https://github.com/libgd/libgd/issues/185#issuecomment-241836950","issue_url":"https://api.github.com/repos/libgd/libgd/issues/185","id":241836950,"user":{"login":"vapier","id":176950,"avatar_url":"https://avatars.githubusercontent.com/u/176950?v=3","gravatar_id":"","url":"https://api.github.com/users/vapier","html_url":"https://github.com/vapier","followers_url":"https://api.github.com/users/vapier/followers","following_url":"https://api.github.com/users/vapier/following{/other_user}","gists_url":"https://api.github.com/users/vapier/gists{/gist_id}","starred_url":"https://api.github.com/users/vapier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vapier/subscriptions","organizations_url":"https://api.github.com/users/vapier/orgs","repos_url":"https://api.github.com/users/vapier/repos","events_url":"https://api.github.com/users/vapier/events{/privacy}","received_events_url":"https://api.github.com/users/vapier/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T18:49:43Z","updated_at":"2016-08-23T18:49:43Z","body":"you could always take an existing free font and hack it up with something like [FontForge](https://fontforge.github.io/) or [Birdfont](https://birdfont.org/).  we don't need the glyphs to be \"correct\", just unique so we can compare them against a reference image."}}
{"actor":{"display_login":"vapier"}}