{"action":"created","issue":{"url":"https://api.github.com/repos/IRkernel/repr/issues/21","repository_url":"https://api.github.com/repos/IRkernel/repr","labels_url":"https://api.github.com/repos/IRkernel/repr/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/IRkernel/repr/issues/21/comments","events_url":"https://api.github.com/repos/IRkernel/repr/issues/21/events","html_url":"https://github.com/IRkernel/repr/issues/21","id":120424502,"number":21,"title":"broken unicode uses <U+884C> which needs to be escaped","user":{"login":"flying-sheep","id":291575,"avatar_url":"https://avatars.githubusercontent.com/u/291575?v=3","gravatar_id":"","url":"https://api.github.com/users/flying-sheep","html_url":"https://github.com/flying-sheep","followers_url":"https://api.github.com/users/flying-sheep/followers","following_url":"https://api.github.com/users/flying-sheep/following{/other_user}","gists_url":"https://api.github.com/users/flying-sheep/gists{/gist_id}","starred_url":"https://api.github.com/users/flying-sheep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flying-sheep/subscriptions","organizations_url":"https://api.github.com/users/flying-sheep/orgs","repos_url":"https://api.github.com/users/flying-sheep/repos","events_url":"https://api.github.com/users/flying-sheep/events{/privacy}","received_events_url":"https://api.github.com/users/flying-sheep/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/IRkernel/repr/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/IRkernel/repr/milestones/1","html_url":"https://github.com/IRkernel/repr/milestones/0.5","labels_url":"https://api.github.com/repos/IRkernel/repr/milestones/1/labels","id":1689515,"number":1,"title":"0.5","description":null,"creator":{"login":"janschulz","id":890156,"avatar_url":"https://avatars.githubusercontent.com/u/890156?v=3","gravatar_id":"","url":"https://api.github.com/users/janschulz","html_url":"https://github.com/janschulz","followers_url":"https://api.github.com/users/janschulz/followers","following_url":"https://api.github.com/users/janschulz/following{/other_user}","gists_url":"https://api.github.com/users/janschulz/gists{/gist_id}","starred_url":"https://api.github.com/users/janschulz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janschulz/subscriptions","organizations_url":"https://api.github.com/users/janschulz/orgs","repos_url":"https://api.github.com/users/janschulz/repos","events_url":"https://api.github.com/users/janschulz/events{/privacy}","received_events_url":"https://api.github.com/users/janschulz/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":3,"state":"open","created_at":"2016-04-07T14:11:54Z","updated_at":"2016-04-09T14:48:10Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2015-12-04T15:29:22Z","updated_at":"2016-04-10T20:51:54Z","closed_at":null,"body":"@takluyver said in https://github.com/IRkernel/IRkernel/pull/224#issuecomment-161316782:\r\n\r\n> I ran into another unicode issue while testing this. If R thinks it can't display a character, it escapes it like this: `<U+884C>` (vs Python style `\\u884c`). These sequences are being included raw in the HTML repr produces, so the browser tries to interpret them as HTML tags and doesn't show anything. repr should probably be escaping strings for the HTML representation.\r\n\r\nplease tell me what makes R output this.\r\n\r\nprobably a good idea to html-encode all character arrays before `repr_html`ing them, but still…"},"comment":{"url":"https://api.github.com/repos/IRkernel/repr/issues/comments/208068752","html_url":"https://github.com/IRkernel/repr/issues/21#issuecomment-208068752","issue_url":"https://api.github.com/repos/IRkernel/repr/issues/21","id":208068752,"user":{"login":"janschulz","id":890156,"avatar_url":"https://avatars.githubusercontent.com/u/890156?v=3","gravatar_id":"","url":"https://api.github.com/users/janschulz","html_url":"https://github.com/janschulz","followers_url":"https://api.github.com/users/janschulz/followers","following_url":"https://api.github.com/users/janschulz/following{/other_user}","gists_url":"https://api.github.com/users/janschulz/gists{/gist_id}","starred_url":"https://api.github.com/users/janschulz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janschulz/subscriptions","organizations_url":"https://api.github.com/users/janschulz/orgs","repos_url":"https://api.github.com/users/janschulz/repos","events_url":"https://api.github.com/users/janschulz/events{/privacy}","received_events_url":"https://api.github.com/users/janschulz/received_events","type":"User","site_admin":false},"created_at":"2016-04-10T20:51:54Z","updated_at":"2016-04-10T20:51:54Z","body":"And here is an example of the evaluate problem:\r\n\r\n```\r\nlibrary(evaluate)\r\n\r\ncode <- \"\r\nx = '法'\r\ny = '\\\\u8FDB'\r\nprint(nchar(x))\r\nprint(nchar(y))\r\nprint(x)\r\nprint(y)\r\n\"\r\n\r\nl = list()\r\ntxt <- function(o, type) {\r\n  t <- paste(o, collapse = '\\n')\r\n  l[length(l)+1] <<- t\r\n}\r\noh <- new_output_handler(source = identity, \r\n                         text = function(o) txt(o, \"text\"), \r\n                         graphics = identity,\r\n                         message = identity, \r\n                         warning = identity, \r\n                         error = identity, \r\n                         value = identity)\r\n\r\nx <- evaluate(code, output_handler = oh)\r\nl\r\n```\r\n\r\n```\r\n> l\r\n[[1]]\r\n[1] \"[1] 8\\n\" #> bad in\r\n\r\n[[2]]\r\n[1] \"[1] 1\\n\" # ok if escaped...\r\n\r\n[[3]]\r\n[1] \"[1] \\\"<U+6CD5>\\\"\\n\" # -> Just the bad in\r\n\r\n[[4]]\r\n[1] \"[1] \\\"<U+8FDB>\\\"\\n\" # -> but here it's bad out...\r\n```"}}