{"action":"created","issue":{"url":"https://api.github.com/repos/haskell-game/sdl2/issues/99","labels_url":"https://api.github.com/repos/haskell-game/sdl2/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/haskell-game/sdl2/issues/99/comments","events_url":"https://api.github.com/repos/haskell-game/sdl2/issues/99/events","html_url":"https://github.com/haskell-game/sdl2/pull/99","id":122661359,"number":99,"title":"Fix peeking text of TextEditingEvent","user":{"login":"masatoko","id":9511433,"avatar_url":"https://avatars.githubusercontent.com/u/9511433?v=3","gravatar_id":"","url":"https://api.github.com/users/masatoko","html_url":"https://github.com/masatoko","followers_url":"https://api.github.com/users/masatoko/followers","following_url":"https://api.github.com/users/masatoko/following{/other_user}","gists_url":"https://api.github.com/users/masatoko/gists{/gist_id}","starred_url":"https://api.github.com/users/masatoko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masatoko/subscriptions","organizations_url":"https://api.github.com/users/masatoko/orgs","repos_url":"https://api.github.com/users/masatoko/repos","events_url":"https://api.github.com/users/masatoko/events{/privacy}","received_events_url":"https://api.github.com/users/masatoko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-17T05:01:13Z","updated_at":"2016-01-01T18:39:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/haskell-game/sdl2/pulls/99","html_url":"https://github.com/haskell-game/sdl2/pull/99","diff_url":"https://github.com/haskell-game/sdl2/pull/99.diff","patch_url":"https://github.com/haskell-game/sdl2/pull/99.patch"},"body":"My program using 'TextInput (IME)' crashed.\r\nThis message below was output.\r\n```\r\nCannot decode byte '\\xa0': Data.Text.Internal.Encoding.decodeUtf8: Invalid UTF-8 stream exit status 1\r\n```\r\n\r\nThis crash occured when ...\r\n1. I typed a Japanese character.\r\n2. SDL_TEXTEDITING.text data is unmarshaled. (This is utf-8 text. And, it is null-terminated.)\r\n3. Try to decode this utf-8 text, however it contains unintended characters after a null character.\r\n\r\nI found the fix of same type for SDL_TEXTINPUT.text data. It was modified a year ago.\r\nSo, I fixed in the same way as that.\r\n\r\nAfter that, I checked my program, and it worked as expected."},"comment":{"url":"https://api.github.com/repos/haskell-game/sdl2/issues/comments/168330391","html_url":"https://github.com/haskell-game/sdl2/pull/99#issuecomment-168330391","issue_url":"https://api.github.com/repos/haskell-game/sdl2/issues/99","id":168330391,"user":{"login":"polarina","id":419473,"avatar_url":"https://avatars.githubusercontent.com/u/419473?v=3","gravatar_id":"","url":"https://api.github.com/users/polarina","html_url":"https://github.com/polarina","followers_url":"https://api.github.com/users/polarina/followers","following_url":"https://api.github.com/users/polarina/following{/other_user}","gists_url":"https://api.github.com/users/polarina/gists{/gist_id}","starred_url":"https://api.github.com/users/polarina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polarina/subscriptions","organizations_url":"https://api.github.com/users/polarina/orgs","repos_url":"https://api.github.com/users/polarina/repos","events_url":"https://api.github.com/users/polarina/events{/privacy}","received_events_url":"https://api.github.com/users/polarina/received_events","type":"User","site_admin":false},"created_at":"2016-01-01T18:39:36Z","updated_at":"2016-01-01T18:39:36Z","body":"The patch looks correct. The SDL documentation says that the char array is null-terminated. Anything after the null-termination byte is presumable useless."}}