{"action":"closed","issue":{"url":"https://api.github.com/repos/nitlang/nit/issues/1796","labels_url":"https://api.github.com/repos/nitlang/nit/issues/1796/labels{/name}","comments_url":"https://api.github.com/repos/nitlang/nit/issues/1796/comments","events_url":"https://api.github.com/repos/nitlang/nit/issues/1796/events","html_url":"https://github.com/nitlang/nit/issues/1796","id":114275838,"number":1796,"title":"Unicode errors in Json static services","user":{"login":"xymus","id":208057,"avatar_url":"https://avatars.githubusercontent.com/u/208057?v=3","gravatar_id":"","url":"https://api.github.com/users/xymus","html_url":"https://github.com/xymus","followers_url":"https://api.github.com/users/xymus/followers","following_url":"https://api.github.com/users/xymus/following{/other_user}","gists_url":"https://api.github.com/users/xymus/gists{/gist_id}","starred_url":"https://api.github.com/users/xymus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xymus/subscriptions","organizations_url":"https://api.github.com/users/xymus/orgs","repos_url":"https://api.github.com/users/xymus/repos","events_url":"https://api.github.com/users/xymus/events{/privacy}","received_events_url":"https://api.github.com/users/xymus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nitlang/nit/labels/bug","name":"bug","color":"eb6420"}],"state":"closed","locked":false,"assignee":{"login":"R4PaSs","id":1444825,"avatar_url":"https://avatars.githubusercontent.com/u/1444825?v=3","gravatar_id":"","url":"https://api.github.com/users/R4PaSs","html_url":"https://github.com/R4PaSs","followers_url":"https://api.github.com/users/R4PaSs/followers","following_url":"https://api.github.com/users/R4PaSs/following{/other_user}","gists_url":"https://api.github.com/users/R4PaSs/gists{/gist_id}","starred_url":"https://api.github.com/users/R4PaSs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/R4PaSs/subscriptions","organizations_url":"https://api.github.com/users/R4PaSs/orgs","repos_url":"https://api.github.com/users/R4PaSs/repos","events_url":"https://api.github.com/users/R4PaSs/events{/privacy}","received_events_url":"https://api.github.com/users/R4PaSs/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2015-10-30T14:03:26Z","updated_at":"2015-11-07T17:38:32Z","closed_at":"2015-11-07T17:38:30Z","body":"Serializing a string to JSON may produce invalid characters.\r\n\r\nI located the problem at the level of `json::static::Text::append_json` in the last `else` block. At that point, it correctly sees the unicode chars, but `buffer.add` may corrupt the char or buffer. You can see the corrupted output in `Text::to_json`.\r\n\r\nReplacing the line `buffer.add char` with `buffer.append char.to_s` works... but @R4PaSs should be able to do better."}}