{"action":"created","issue":{"url":"https://api.github.com/repos/arduino/Arduino/issues/4801","repository_url":"https://api.github.com/repos/arduino/Arduino","labels_url":"https://api.github.com/repos/arduino/Arduino/issues/4801/labels{/name}","comments_url":"https://api.github.com/repos/arduino/Arduino/issues/4801/comments","events_url":"https://api.github.com/repos/arduino/Arduino/issues/4801/events","html_url":"https://github.com/arduino/Arduino/pull/4801","id":145348090,"number":4801,"title":"Adding encoding support to serial monitor","user":{"login":"PaulMurrayCbr","id":877991,"avatar_url":"https://avatars.githubusercontent.com/u/877991?v=3","gravatar_id":"","url":"https://api.github.com/users/PaulMurrayCbr","html_url":"https://github.com/PaulMurrayCbr","followers_url":"https://api.github.com/users/PaulMurrayCbr/followers","following_url":"https://api.github.com/users/PaulMurrayCbr/following{/other_user}","gists_url":"https://api.github.com/users/PaulMurrayCbr/gists{/gist_id}","starred_url":"https://api.github.com/users/PaulMurrayCbr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PaulMurrayCbr/subscriptions","organizations_url":"https://api.github.com/users/PaulMurrayCbr/orgs","repos_url":"https://api.github.com/users/PaulMurrayCbr/repos","events_url":"https://api.github.com/users/PaulMurrayCbr/events{/privacy}","received_events_url":"https://api.github.com/users/PaulMurrayCbr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-02T07:39:34Z","updated_at":"2016-04-02T19:31:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/arduino/Arduino/pulls/4801","html_url":"https://github.com/arduino/Arduino/pull/4801","diff_url":"https://github.com/arduino/Arduino/pull/4801.diff","patch_url":"https://github.com/arduino/Arduino/pull/4801.patch"},"body":"This pull request adds enoding support to the serial monitor.\r\n\r\nThe core Serial class is altered to work primarily with java bytes rather than java chars. However, the existing methods are retained for backward compatibility.\r\n\r\nCombo boxes for Tx and Rx character sets are added. The serial monitor works in the IDE on my mac, and was tested with a simple echo sketch on an Arduino Uno. As expected, when accented characters are typed into the serial monitor and sent\r\n\r\nTx: US-ASCII, Rx: US-ASCII, accented characters are replaced with qmarks by the encoder\r\nTx: US-ASCII, Rx: UTF-8, accented characters are replaced with qmarks by the encoder\r\nTx: UTF-8, Rx: US-ASCII, accented characters are recieved back as two bytes of rubbish\r\nTx: UTF-8, Rx: UTF-8, accented characters come through correctly\r\n\r\nNote that line breaks do odd things when, for instance, UTF-16 is selected as the encoding, as does sending one character at a time when transmitting US-ASCII and receiving UTF-16. This is correct … ish. I did not implement a full encoding/decoding buffer. The messages are assumed to be complete as they arrive. This may cause glitches when reading bulk UTF-8 output from the Arduino, and may need to be addressed.\r\n\r\nI don't know how to exercise the other classes - Network Monitor, Serial Plotter.\r\n\r\nA difficulty is the use of the MessageConsumer interface. Messages are text, not bytes, but NetworkMonitor used that interface to do its job. I am not sure that my handling is correct, although I have tried to do the sane thing."},"comment":{"url":"https://api.github.com/repos/arduino/Arduino/issues/comments/204787229","html_url":"https://github.com/arduino/Arduino/pull/4801#issuecomment-204787229","issue_url":"https://api.github.com/repos/arduino/Arduino/issues/4801","id":204787229,"user":{"login":"cousteaulecommandant","id":6584870,"avatar_url":"https://avatars.githubusercontent.com/u/6584870?v=3","gravatar_id":"","url":"https://api.github.com/users/cousteaulecommandant","html_url":"https://github.com/cousteaulecommandant","followers_url":"https://api.github.com/users/cousteaulecommandant/followers","following_url":"https://api.github.com/users/cousteaulecommandant/following{/other_user}","gists_url":"https://api.github.com/users/cousteaulecommandant/gists{/gist_id}","starred_url":"https://api.github.com/users/cousteaulecommandant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cousteaulecommandant/subscriptions","organizations_url":"https://api.github.com/users/cousteaulecommandant/orgs","repos_url":"https://api.github.com/users/cousteaulecommandant/repos","events_url":"https://api.github.com/users/cousteaulecommandant/events{/privacy}","received_events_url":"https://api.github.com/users/cousteaulecommandant/received_events","type":"User","site_admin":false},"created_at":"2016-04-02T19:31:53Z","updated_at":"2016-04-02T19:31:53Z","body":"I'd consider using Windows-1252 rather than ISO-8859-1, as this one replaces the control characters from 128 to 159 with printing characters (except for 5 of them), so it's mostly a superset of it (not counting the control characters).\r\nBy the way, isn't \"plain\" UTF-16 just like UTF-16BE/LE but with a byte order mask at the beginning?  Isn't it a bad idea to send a BOM every time you send a line?"}}