{"action":"closed","issue":{"url":"https://api.github.com/repos/wpilibsuite/ntcore/issues/69","repository_url":"https://api.github.com/repos/wpilibsuite/ntcore","labels_url":"https://api.github.com/repos/wpilibsuite/ntcore/issues/69/labels{/name}","comments_url":"https://api.github.com/repos/wpilibsuite/ntcore/issues/69/comments","events_url":"https://api.github.com/repos/wpilibsuite/ntcore/issues/69/events","html_url":"https://github.com/wpilibsuite/ntcore/issues/69","id":159540176,"number":69,"title":"Java NetworkTables Server incorrectly encodes Supplementary Multilingual Plane with Surrogate Pairs (artf3973)","user":{"login":"PeterJohnson","id":297126,"avatar_url":"https://avatars.githubusercontent.com/u/297126?v=3","gravatar_id":"","url":"https://api.github.com/users/PeterJohnson","html_url":"https://github.com/PeterJohnson","followers_url":"https://api.github.com/users/PeterJohnson/followers","following_url":"https://api.github.com/users/PeterJohnson/following{/other_user}","gists_url":"https://api.github.com/users/PeterJohnson/gists{/gist_id}","starred_url":"https://api.github.com/users/PeterJohnson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PeterJohnson/subscriptions","organizations_url":"https://api.github.com/users/PeterJohnson/orgs","repos_url":"https://api.github.com/users/PeterJohnson/repos","events_url":"https://api.github.com/users/PeterJohnson/events{/privacy}","received_events_url":"https://api.github.com/users/PeterJohnson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-10T01:02:15Z","updated_at":"2016-06-11T02:24:42Z","closed_at":"2016-06-11T02:24:42Z","body":"The NWT spec says that all strings are UTF8. Pasting the string \"cat🐱mouse\" (\"cat\\u{1F431}mouse\") in outline viewer as a server should encode it in UTF-8 as the binary string \"cat\\xF0\\x9F\\x90\\xB1mouse\". However the actual string sent across the network is \"cat\\xED\\xA0\\xBD\\xED\\xB0\\xB1mouse\" which is the UTF-8 encoding of \"cat\\xD8\\x3D\\xDC\\x31mouse\", where \"\\uD83D\\uDC31\" is the UTF-16 surrogate pair encoding of \\u{1F431} (🐱)\r\n\r\nThus, it appears that surrogate pairs for characters that are not in Unicode Plane 0 are not being re-encoded in utf-8 properly. \r\n\r\nSending a correct UTF-8 encoding (\"cat\\xF0\\x9F\\x90\\xB1mouse\") via a custom C++ NWT client causes the java server to crash and Outline viewer to stop responding to updates or sending out updates and this error is printed:\r\n\r\n`edu.wpi.first.wpilibj.networktables2.server.ServerConnectionAdapter@6a59828c entered connection state: SERVER_ERROR: class java.io.UTFDataFormatException: malformed input around byte 3`"}}
{"actor":{"display_login":"PeterJohnson"}}